File tree 2 files changed +26
-0
lines changed
Microsoft.Spark.E2ETest/IpcTests/Sql
2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -673,6 +673,14 @@ public void TestSignaturesV2_4_X()
673
673
_df . IntersectAll ( _df ) ;
674
674
675
675
_df . ExceptAll ( _df ) ;
676
+
677
+ {
678
+ RelationalGroupedDataset df = _df . GroupBy ( "name" ) ;
679
+
680
+ Assert . IsType < RelationalGroupedDataset > ( df . Pivot ( "age" ) ) ;
681
+
682
+ Assert . IsType < RelationalGroupedDataset > ( df . Pivot ( Col ( "age" ) ) ) ;
683
+ }
676
684
}
677
685
}
678
686
}
Original file line number Diff line number Diff line change @@ -85,6 +85,24 @@ public DataFrame Min(params string[] colNames) =>
85
85
public DataFrame Sum ( params string [ ] colNames ) =>
86
86
new DataFrame ( ( JvmObjectReference ) _jvmObject . Invoke ( "sum" , ( object ) colNames ) ) ;
87
87
88
+ /// <summary>
89
+ /// Pivots a column of the current DataFrame and performs the specified aggregation.
90
+ /// </summary>
91
+ /// <param name="pivotColumn">Name of the column to pivot</param>
92
+ /// <returns>New RelationalGroupedDataset object with pivot applied</returns>
93
+ public RelationalGroupedDataset Pivot ( string pivotColumn ) =>
94
+ new RelationalGroupedDataset (
95
+ ( JvmObjectReference ) _jvmObject . Invoke ( "pivot" , pivotColumn ) , _dataFrame ) ;
96
+
97
+ /// <summary>
98
+ /// Pivots a column of the current DataFrame and performs the specified aggregation.
99
+ /// </summary>
100
+ /// <param name="pivotColumn">The column to pivot</param>
101
+ /// <returns>New RelationalGroupedDataset object with pivot applied</returns>
102
+ public RelationalGroupedDataset Pivot ( Column pivotColumn ) =>
103
+ new RelationalGroupedDataset (
104
+ ( JvmObjectReference ) _jvmObject . Invoke ( "pivot" , pivotColumn ) , _dataFrame ) ;
105
+
88
106
internal DataFrame Apply ( StructType returnType , Func < FxDataFrame , FxDataFrame > func )
89
107
{
90
108
DataFrameGroupedMapWorkerFunction . ExecuteDelegate wrapper =
You can’t perform that action at this time.
0 commit comments