Fix NPE when the key is null in GroupBy

Fix the issue that when the key is null, groupby will throw NPE.