bgjackma commented on code in PR #12565:
URL: https://github.com/apache/datafusion/pull/12565#discussion_r1769668538
##########
datafusion/physical-plan/src/aggregates/row_hash.rs:
##########
@@ -578,7 +579,13 @@ impl GroupedHashAggregateStream {
/// [`GroupsAccumulatorAdapter`] if not.
pub(crate) fn create_group_accumulator(
agg_expr: &AggregateFunctionExpr,
+ group_by: &PhysicalGroupBy,
) -> Result<Box<dyn GroupsAccumulator>> {
+ // GROUPING is a special fxn that exposes info about group organization
+ if let Some(grouping) =
agg_expr.fun().inner().as_any().downcast_ref::<Grouping>() {
+ let args = agg_expr.all_expressions().args;
+ return grouping.create_grouping_accumulator(&args, &group_by.expr);
+ }
Review Comment:
It's kind of in a weird place, it's sort of not a real aggregation function
but instead a way to leak metadata. That might be a reason to make it a
built-in.
Do you have ideas about how and when to go about doing that?
There's another function called GROUP_ID (not to be confused with
GROUPING_ID) which disambiguates duplicate rows, it might be relevant.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]