@@ -88,8 +88,6 @@ pub struct BoundedWindowAggExec {
8888 window_expr : Vec < Arc < dyn WindowExpr > > ,
8989 /// Schema after the window is run
9090 schema : SchemaRef ,
91- /// Schema before the window
92- input_schema : SchemaRef ,
9391 /// Partition Keys
9492 pub partition_keys : Vec < Arc < dyn PhysicalExpr > > ,
9593 /// Execution metrics
@@ -110,11 +108,10 @@ impl BoundedWindowAggExec {
110108 pub fn try_new (
111109 window_expr : Vec < Arc < dyn WindowExpr > > ,
112110 input : Arc < dyn ExecutionPlan > ,
113- input_schema : SchemaRef ,
114111 partition_keys : Vec < Arc < dyn PhysicalExpr > > ,
115112 partition_search_mode : PartitionSearchMode ,
116113 ) -> Result < Self > {
117- let schema = create_schema ( & input_schema , & window_expr) ?;
114+ let schema = create_schema ( & input . schema ( ) , & window_expr) ?;
118115 let schema = Arc :: new ( schema) ;
119116 let partition_by_exprs = window_expr[ 0 ] . partition_by ( ) ;
120117 let ordered_partition_by_indices = match & partition_search_mode {
@@ -140,7 +137,6 @@ impl BoundedWindowAggExec {
140137 input,
141138 window_expr,
142139 schema,
143- input_schema,
144140 partition_keys,
145141 metrics : ExecutionPlanMetricsSet :: new ( ) ,
146142 partition_search_mode,
@@ -158,11 +154,6 @@ impl BoundedWindowAggExec {
158154 & self . input
159155 }
160156
161- /// Get the input schema before any window functions are applied
162- pub fn input_schema ( & self ) -> SchemaRef {
163- self . input_schema . clone ( )
164- }
165-
166157 /// Return the output sort order of partition keys: For example
167158 /// OVER(PARTITION BY a, ORDER BY b) -> would give sorting of the column a
168159 // We are sure that partition by columns are always at the beginning of sort_keys
@@ -303,7 +294,6 @@ impl ExecutionPlan for BoundedWindowAggExec {
303294 Ok ( Arc :: new ( BoundedWindowAggExec :: try_new (
304295 self . window_expr . clone ( ) ,
305296 children[ 0 ] . clone ( ) ,
306- self . input_schema . clone ( ) ,
307297 self . partition_keys . clone ( ) ,
308298 self . partition_search_mode . clone ( ) ,
309299 ) ?) )
@@ -333,7 +323,7 @@ impl ExecutionPlan for BoundedWindowAggExec {
333323 fn statistics ( & self ) -> Statistics {
334324 let input_stat = self . input . statistics ( ) ;
335325 let win_cols = self . window_expr . len ( ) ;
336- let input_cols = self . input_schema . fields ( ) . len ( ) ;
326+ let input_cols = self . input . schema ( ) . fields ( ) . len ( ) ;
337327 // TODO stats: some windowing function will maintain invariants such as min, max...
338328 let mut column_statistics = Vec :: with_capacity ( win_cols + input_cols) ;
339329 if let Some ( input_col_stats) = input_stat. column_statistics {
0 commit comments