Github user chenghao-intel commented on a diff in the pull request:

    https://github.com/apache/spark/pull/6311#discussion_r30773786
  
    --- Diff: python/pyspark/sql/dataframe.py ---
    @@ -755,6 +755,52 @@ def groupBy(self, *cols):
             from pyspark.sql.group import GroupedData
             return GroupedData(jdf, self.sql_ctx)
     
    +    def rollup(self, *cols):
    +        """
    +        Create a multi-dimensional rollup for the current 
:class:`DataFrame` using
    +        the specified columns, so we can run aggregation on them.
    +
    +        >>> df.rollup('name', df.age).count().show()
    +        +-----+----+-----+
    +        | name| age|count|
    +        +-----+----+-----+
    +        |Alice|null|    1|
    +        |  Bob|   5|    1|
    +        |  Bob|null|    1|
    +        | null|null|    2|
    +        |Alice|   2|    1|
    +        +-----+----+-----+
    +
    +        .. versionadded:: 1.4
    +        """
    +        jdf = self._jdf.rollup(self._jcols(*cols))
    --- End diff --
    
    `jdf` -> `jgd`? otherwise it's probably confusing.


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