File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
Microsoft.Spark.E2ETest/IpcTests/Sql Expand file tree Collapse file tree 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()
673673 _df . IntersectAll ( _df ) ;
674674
675675 _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+ }
676684 }
677685 }
678686}
Original file line number Diff line number Diff line change @@ -85,6 +85,24 @@ public DataFrame Min(params string[] colNames) =>
8585 public DataFrame Sum ( params string [ ] colNames ) =>
8686 new DataFrame ( ( JvmObjectReference ) _jvmObject . Invoke ( "sum" , ( object ) colNames ) ) ;
8787
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+
88106 internal DataFrame Apply ( StructType returnType , Func < FxDataFrame , FxDataFrame > func )
89107 {
90108 DataFrameGroupedMapWorkerFunction . ExecuteDelegate wrapper =
You can’t perform that action at this time.
0 commit comments