Skip to content
Snippets Groups Projects
  • Davies Liu's avatar
    b5761d15
    [SPARK-12706] [SQL] grouping() and grouping_id() · b5761d15
    Davies Liu authored
    Grouping() returns a column is aggregated or not, grouping_id() returns the aggregation levels.
    
    grouping()/grouping_id() could be used with window function, but does not work in having/sort clause, will be fixed by another PR.
    
    The GROUPING__ID/grouping_id() in Hive is wrong (according to docs), we also did it wrongly, this PR change that to match the behavior in most databases (also the docs of Hive).
    
    Author: Davies Liu <davies@databricks.com>
    
    Closes #10677 from davies/grouping.
    b5761d15
    History
    [SPARK-12706] [SQL] grouping() and grouping_id()
    Davies Liu authored
    Grouping() returns a column is aggregated or not, grouping_id() returns the aggregation levels.
    
    grouping()/grouping_id() could be used with window function, but does not work in having/sort clause, will be fixed by another PR.
    
    The GROUPING__ID/grouping_id() in Hive is wrong (according to docs), we also did it wrongly, this PR change that to match the behavior in most databases (also the docs of Hive).
    
    Author: Davies Liu <davies@databricks.com>
    
    Closes #10677 from davies/grouping.