The grouping() and grouping_id() indicator functions used with ROLLUP, CUBE, and GROUPING SETS are currently marked as unsupported (🔜) in the expressions guide.
These are Unevaluable expressions that Spark's analyzer rewrites before physical planning:
grouping(col) becomes Cast(BitwiseAnd(ShiftRight(spark_grouping_id, n-1-i), 1L), ByteType)
grouping_id() becomes a reference to the spark_grouping_id virtual column
All of the constituent pieces (the ExpandExec operator plus Cast, BitwiseAnd, ShiftRight, and Literal) are already supported by Comet, so these queries already run natively end-to-end. This issue tracks adding test coverage and marking the functions as supported.
The
grouping()andgrouping_id()indicator functions used withROLLUP,CUBE, andGROUPING SETSare currently marked as unsupported (🔜) in the expressions guide.These are
Unevaluableexpressions that Spark's analyzer rewrites before physical planning:grouping(col)becomesCast(BitwiseAnd(ShiftRight(spark_grouping_id, n-1-i), 1L), ByteType)grouping_id()becomes a reference to thespark_grouping_idvirtual columnAll of the constituent pieces (the
ExpandExecoperator plusCast,BitwiseAnd,ShiftRight, andLiteral) are already supported by Comet, so these queries already run natively end-to-end. This issue tracks adding test coverage and marking the functions as supported.