westonpace commented on code in PR #12863:
URL: https://github.com/apache/datafusion/pull/12863#discussion_r1801420132


##########
datafusion/substrait/src/logical_plan/producer.rs:
##########
@@ -764,6 +768,7 @@ pub fn operator_to_name(op: Operator) -> &'static str {
     }
 }
 
+#[allow(deprecated)]

Review Comment:
   Yeah, it's not a rush, and might be better to stick with the old approach 
for now for producers until consumers have had a chance to catch up.
   
   The new approach puts the `grouping_expressions` in the `AggregateRel` (so 
in `to_substrait_agg_measure`) and not in the `Grouping`.  Instead, the 
`Grouping` has a list of indices into the `AggregateRel`'s 
`grouping_expressions`.
   
   E.g. instead of...
   
   ```
   AggregateRel = {
     "groupings": [
       { "grouping_expressions": [expr_1, epxr_2] }
     ]
   }
   ```
   
   You would have...
   
   ```
   AggregateRel = {
     "grouping_expressions": [expr_1, expr_2],
     "groupings": [
       { "expression_references": [0, 1] }
      ]
   }
   ```
   
   This makes it easier to recognize something like a rollup:
   
   ```
   AggregateRel = {
     "grouping_expressions": [expr_1, expr_2],
     "groupings": [
       { "expression_references": [0, 1] },
       { "expression_references": [0] },
       { "expression_references": [] }
      ]
   }
   ```



-- 
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]

Reply via email to