Github user liancheng commented on the pull request:

    https://github.com/apache/spark/pull/11283#issuecomment-192624981
  
    A final thought about this PR:
    
    For SQL generation for grouping sets, we have to depend on a set of 
implicit assumptions related to implementation details of specific analysis 
rules, which makes the implementation tend to be fragile. I think maybe we can 
add an auxiliary logical plan operator `AnnotatePlan` and a expression 
`AnnotateExpression`, which can be used to annotate a sub-tree of a logical 
plan / expression to indicate their original form. These nodes should be erased 
by the optimizer.
    
    Haven't thought thoroughly about this, but with the help of these 
annotations, I'd expect it to be easier to recognize patterns corresponding to 
plans / expressions like grouping set, grouping, multi-distinct aggregation 
etc..


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to