cube

What is the difference between cube, rollup and groupBy operators?

我是研究僧i 提交于 2019-11-27 00:11:02
问题 Question is pretty much in the title. I can't find any detailed documentation regarding the differences. I do notice a difference because when interchanging cube and groupBy function calls, I get different results. I noticed that for the result using 'cube', I got a lot of null values on the expressions I often grouped by. 回答1: These are not intended to work in the same way. groupBy is simply an equivalent of the GROUP BY clause in standard SQL. In other words table.groupBy($"foo", $"bar") is