@@ -65,22 +65,21 @@ use datafusion_common::display::ToStringifiedPlan;
6565use datafusion_common:: tree_node:: { TreeNode , TreeNodeRecursion , TreeNodeVisitor } ;
6666use datafusion_common:: {
6767 exec_err, internal_datafusion_err, internal_err, not_impl_err, plan_err, DFSchema ,
68- ScalarValue , Column ,
68+ ScalarValue ,
6969} ;
7070use datafusion_datasource:: memory:: MemorySourceConfig ;
71- use datafusion_expr:: dml:: { CopyTo , InsertOp , DmlStatement , WriteOp } ;
71+ use datafusion_expr:: dml:: { CopyTo , InsertOp } ;
7272use datafusion_expr:: expr:: {
7373 physical_name, AggregateFunction , AggregateFunctionParams , Alias , GroupingSet ,
7474 WindowFunction , WindowFunctionParams ,
7575} ;
7676use datafusion_expr:: expr_rewriter:: unnormalize_cols;
7777use datafusion_expr:: logical_plan:: builder:: wrap_projection_for_join_if_necessary;
7878use datafusion_expr:: {
79- Analyze , DescribeTable , DmlStatement , Explain , ExplainFormat , Extension , FetchType ,
80- Filter , JoinType , RecursiveQuery , SkipType , SortExpr , StringifiedPlan , WindowFrame ,
81- WindowFrameBound , WriteOp , SubqueryAlias , LogicalPlanBuilder , BinaryExpr
79+ Analyze , DescribeTable , DmlStatement , Explain , ExplainFormat , Extension , FetchType ,
80+ Filter , JoinType , RecursiveQuery , SkipType , StringifiedPlan , WindowFrame ,
81+ WindowFrameBound , WriteOp , LogicalPlanBuilder , BinaryExpr
8282} ;
83- use datafusion_execution:: FunctionRegistry ;
8483use datafusion_physical_expr:: aggregate:: { AggregateExprBuilder , AggregateFunctionExpr } ;
8584use datafusion_physical_expr:: expressions:: { Column , Literal } ;
8685use datafusion_physical_expr:: LexOrdering ;
@@ -1740,22 +1739,22 @@ pub use datafusion_physical_expr::{
17401739pub fn transform_pivot_to_aggregate (
17411740 input : Arc < LogicalPlan > ,
17421741 aggregate_expr : & Expr ,
1743- pivot_column : & Column ,
1742+ pivot_column : & datafusion_common :: Column ,
17441743 pivot_values : Vec < ScalarValue > ,
17451744) -> Result < LogicalPlan > {
17461745 let df_schema = input. schema ( ) ;
17471746
1748- let all_columns: Vec < Column > = df_schema. columns ( ) ;
1747+ let all_columns: Vec < datafusion_common :: Column > = df_schema. columns ( ) ;
17491748
17501749 // Filter to include only columns we want for GROUP BY
17511750 // (exclude pivot column and aggregate expression columns)
17521751 let group_by_columns: Vec < Expr > = all_columns
17531752 . into_iter ( )
1754- . filter ( |col| {
1753+ . filter ( |col : & datafusion_common :: Column | {
17551754 col. name != pivot_column. name
17561755 && !aggregate_expr. column_refs ( ) . iter ( ) . any ( |agg_col| agg_col. name == col. name )
17571756 } )
1758- . map ( |col| Expr :: Column ( col) )
1757+ . map ( |col : datafusion_common :: Column | Expr :: Column ( col) )
17591758 . collect ( ) ;
17601759
17611760 let builder = LogicalPlanBuilder :: from ( Arc :: unwrap_or_clone ( input. clone ( ) ) ) ;
@@ -2183,7 +2182,7 @@ impl DefaultPhysicalPlanner {
21832182 if !physical_exprs. iter ( ) . any ( |( _, name) | name == field. name ( ) ) {
21842183 // Add this pivot column to the projection
21852184 all_exprs. push ( (
2186- Arc :: new ( crate :: physical_plan :: expressions :: Column :: new ( field. name ( ) , i) ) as Arc < dyn PhysicalExpr > ,
2185+ Arc :: new ( Column :: new ( field. name ( ) , i) ) as Arc < dyn PhysicalExpr > ,
21872186 field. name ( ) . clone ( ) ,
21882187 ) ) ;
21892188 }
0 commit comments