Exception in thread "main" org.apache.spark.sql.AnalysisException: grouping expressions sequence is empty, and 'ods_user_behavior_click.`uid`' is not an aggregate function. Wrap '((IF((sum(ods_user_behavior_click.`rating`) IS NULL), CAST(NULL AS DOUBLE), UDF(sum(rating)))) AS `rating`)' in windowing function(s) or wrap 'ods_user_behavior_click.`uid`' in first() (or first_value) if you don't care which value you get.;;
Aggregate [uid#4L, item_id#5L, if (isnull(sum(rating#6))) null else UDF(sum(rating#6)) AS rating#0]