@@ -685,10 +685,13 @@ class DataFrame private[sql](
685685 * @since 1.3.0
686686 */
687687 @ scala.annotation.varargs
688- def groupBy (cols : Column * ): GroupedData = new GroupedData (this , cols.map(_.expr), GroupByType )
688+ def groupBy (cols : Column * ): GroupedData = {
689+ GroupedData (this , cols.map(_.expr), GroupedData .GroupByType )
690+ }
689691
690692 /**
691- * Rollup the [[DataFrame ]] using the specified columns, so we can run aggregation on them.
693+ * Create a multi-dimensional rollup for the current [[DataFrame ]] using the specified columns,
694+ * so we can run aggregation on them.
692695 * See [[GroupedData ]] for all the available aggregate functions.
693696 *
694697 * {{{
@@ -705,10 +708,13 @@ class DataFrame private[sql](
705708 * @since 1.4.0
706709 */
707710 @ scala.annotation.varargs
708- def rollup (cols : Column * ): GroupedData = new GroupedData (this , cols.map(_.expr), RollupType )
711+ def rollup (cols : Column * ): GroupedData = {
712+ GroupedData (this , cols.map(_.expr), GroupedData .RollupType )
713+ }
709714
710715 /**
711- * Cube the [[DataFrame ]] using the specified columns, so we can run aggregation on them.
716+ * Create a multi-dimensional cube for the current [[DataFrame ]] using the specified columns,
717+ * so we can run aggregation on them.
712718 * See [[GroupedData ]] for all the available aggregate functions.
713719 *
714720 * {{{
@@ -725,7 +731,7 @@ class DataFrame private[sql](
725731 * @since 1.4.0
726732 */
727733 @ scala.annotation.varargs
728- def cube (cols : Column * ): GroupedData = new GroupedData (this , cols.map(_.expr), CubeType )
734+ def cube (cols : Column * ): GroupedData = GroupedData (this , cols.map(_.expr), GroupedData . CubeType )
729735
730736 /**
731737 * Groups the [[DataFrame ]] using the specified columns, so we can run aggregation on them.
@@ -750,14 +756,15 @@ class DataFrame private[sql](
750756 @ scala.annotation.varargs
751757 def groupBy (col1 : String , cols : String * ): GroupedData = {
752758 val colNames : Seq [String ] = col1 +: cols
753- new GroupedData (this , colNames.map(colName => resolve(colName)), GroupByType )
759+ GroupedData (this , colNames.map(colName => resolve(colName)), GroupedData . GroupByType )
754760 }
755761
756762 /**
757- * Rollup the [[DataFrame ]] using the specified columns, so we can run aggregation on them.
763+ * Create a multi-dimensional rollup for the current [[DataFrame ]] using the specified columns,
764+ * so we can run aggregation on them.
758765 * See [[GroupedData ]] for all the available aggregate functions.
759766 *
760- * This is a variant of groupBy that can only group by existing columns using column names
767+ * This is a variant of rollup that can only group by existing columns using column names
761768 * (i.e. cannot construct expressions).
762769 *
763770 * {{{
@@ -776,14 +783,15 @@ class DataFrame private[sql](
776783 @ scala.annotation.varargs
777784 def rollup (col1 : String , cols : String * ): GroupedData = {
778785 val colNames : Seq [String ] = col1 +: cols
779- new GroupedData (this , colNames.map(colName => resolve(colName)), RollupType )
786+ GroupedData (this , colNames.map(colName => resolve(colName)), GroupedData . RollupType )
780787 }
781788
782789 /**
783- * Cube the [[DataFrame ]] using the specified columns, so we can run aggregation on them.
790+ * Create a multi-dimensional cube for the current [[DataFrame ]] using the specified columns,
791+ * so we can run aggregation on them.
784792 * See [[GroupedData ]] for all the available aggregate functions.
785793 *
786- * This is a variant of groupBy that can only group by existing columns using column names
794+ * This is a variant of cube that can only group by existing columns using column names
787795 * (i.e. cannot construct expressions).
788796 *
789797 * {{{
@@ -802,7 +810,7 @@ class DataFrame private[sql](
802810 @ scala.annotation.varargs
803811 def cube (col1 : String , cols : String * ): GroupedData = {
804812 val colNames : Seq [String ] = col1 +: cols
805- new GroupedData (this , colNames.map(colName => resolve(colName)), CubeType )
813+ GroupedData (this , colNames.map(colName => resolve(colName)), GroupedData . CubeType )
806814 }
807815
808816 /**
0 commit comments