我想按年获得每列的总和。而是显示同一年的几个单独的行。
spark.sql("""
SELECT YEAR(date) AS year,
useful, funny, cool
FROM reviews_without_text_table
ORDER by year ASC;
""").show(truncate=False)
[在此处输入图片描述][1]
请在此处查看附件:[1]:https ://i.stack.imgur.com/nYIrA.png
我想按年获得每列的总和。而是显示同一年的几个单独的行。
spark.sql("""
SELECT YEAR(date) AS year,
useful, funny, cool
FROM reviews_without_text_table
ORDER by year ASC;
""").show(truncate=False)
[在此处输入图片描述][1]
请在此处查看附件:[1]:https ://i.stack.imgur.com/nYIrA.png