Github user aray commented on a diff in the pull request:

    https://github.com/apache/spark/pull/10677#discussion_r50137528
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/functions.scala ---
    @@ -324,6 +324,51 @@ object functions extends LegacyFunctions {
        */
       def first(columnName: String): Column = first(Column(columnName))
     
    +
    +  /**
    +    * Aggregate function: indicates whether a specified column in a GROUP 
BY list is aggregated
    +    * or not, returns 1 for aggregated or 0 for not aggregated in the 
result set.
    +    *
    +    * @group agg_funcs
    +    * @since 2.0.0
    +    */
    +  def grouping(e: Column): Column = Column(Grouping(e.expr))
    +
    +  /**
    +    * Aggregate function: indicates whether a specified column in a GROUP 
BY list is aggregated
    +    * or not, returns 1 for aggregated or 0 for not aggregated in the 
result set.
    +    *
    +    * @group agg_funcs
    +    * @since 2.0.0
    +    */
    +  def grouping(columnName: String): Column = grouping(Column(columnName))
    +
    +  /**
    +    * Aggregate function: returns the level of grouping, equals to
    +    *
    +    *   (grouping(c1) << (n-1)) + (grouping(c1) << (n-2)) + ... + 
grouping(cn)
    --- End diff --
    
    Second term should be grouping(c**2**)


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