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

    https://github.com/apache/spark/pull/6257#discussion_r30666841
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/DataFrame.scala ---
    @@ -685,7 +685,47 @@ class DataFrame private[sql](
        * @since 1.3.0
        */
       @scala.annotation.varargs
    -  def groupBy(cols: Column*): GroupedData = new GroupedData(this, 
cols.map(_.expr))
    +  def groupBy(cols: Column*): GroupedData = new GroupedData(this, 
cols.map(_.expr), GroupByType)
    +
    +  /**
    +   * Rollup the [[DataFrame]] using the specified columns, so we can run 
aggregation on them.
    +   * See [[GroupedData]] for all the available aggregate functions.
    +   *
    +   * {{{
    +   *   // Compute the average for all numeric columns rolluped by 
department and group.
    +   *   df.rollup($"department", $"group").avg()
    +   *
    +   *   // Compute the max age and average salary, rolluped by department 
and gender.
    +   *   df.rollup($"department", $"gender").agg(Map(
    +   *     "salary" -> "avg",
    +   *     "age" -> "max"
    +   *   ))
    +   * }}}
    +   * @group dfops
    +   * @since 1.4.0
    +   */
    +  @scala.annotation.varargs
    +  def rollup(cols: Column*): GroupedData = new GroupedData(this, 
cols.map(_.expr), RollupType)
    +
    +  /**
    +   * Cube the [[DataFrame]] using the specified columns, so we can run 
aggregation on them.
    --- End diff --
    
    ```
    Creates a multidimensional cube for the current [[DataFrame]].
    ```


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