Details
-
Sub-task
-
Status: Open
-
Major
-
Resolution: Unresolved
-
3.0.0
-
None
-
None
Description
In PgSQL, grouping() can have multiple arguments, but Spark grouping() must have a single argument (https://github.com/apache/spark/blob/master/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/grouping.scala#L100);
postgres=# select a, b, grouping(a, b), sum(v), count(*), max(v) postgres-# from gstest1 group by rollup (a,b); a | b | grouping | sum | count | max ---+---+----------+-----+-------+----- | | 3 | | 0 | (1 row)
See a doc for the form: https://www.postgresql.org/docs/12/functions-aggregate.html (Table 9.59. Grouping Operations)