@@ -685,10 +685,13 @@ class DataFrame private[sql](
685
685
* @since 1.3.0
686
686
*/
687
687
@ 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
+ }
689
691
690
692
/**
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.
692
695
* See [[GroupedData ]] for all the available aggregate functions.
693
696
*
694
697
* {{{
@@ -705,10 +708,13 @@ class DataFrame private[sql](
705
708
* @since 1.4.0
706
709
*/
707
710
@ 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
+ }
709
714
710
715
/**
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.
712
718
* See [[GroupedData ]] for all the available aggregate functions.
713
719
*
714
720
* {{{
@@ -725,7 +731,7 @@ class DataFrame private[sql](
725
731
* @since 1.4.0
726
732
*/
727
733
@ 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 )
729
735
730
736
/**
731
737
* Groups the [[DataFrame ]] using the specified columns, so we can run aggregation on them.
@@ -750,14 +756,15 @@ class DataFrame private[sql](
750
756
@ scala.annotation.varargs
751
757
def groupBy (col1 : String , cols : String * ): GroupedData = {
752
758
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 )
754
760
}
755
761
756
762
/**
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.
758
765
* See [[GroupedData ]] for all the available aggregate functions.
759
766
*
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
761
768
* (i.e. cannot construct expressions).
762
769
*
763
770
* {{{
@@ -776,14 +783,15 @@ class DataFrame private[sql](
776
783
@ scala.annotation.varargs
777
784
def rollup (col1 : String , cols : String * ): GroupedData = {
778
785
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 )
780
787
}
781
788
782
789
/**
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.
784
792
* See [[GroupedData ]] for all the available aggregate functions.
785
793
*
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
787
795
* (i.e. cannot construct expressions).
788
796
*
789
797
* {{{
@@ -802,7 +810,7 @@ class DataFrame private[sql](
802
810
@ scala.annotation.varargs
803
811
def cube (col1 : String , cols : String * ): GroupedData = {
804
812
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 )
806
814
}
807
815
808
816
/**
0 commit comments