File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ use common_expression::DataBlock;
2525use common_expression:: DataSchemaRef ;
2626use common_expression:: FunctionContext ;
2727use common_expression:: HashMethodKind ;
28+ use common_expression:: RemoteExpr ;
2829use common_expression:: SortColumnDescription ;
2930use common_functions:: aggregates:: AggregateFunctionFactory ;
3031use common_functions:: aggregates:: AggregateFunctionRef ;
@@ -382,6 +383,12 @@ impl PipelineBuilder {
382383 let exprs = eval_scalar
383384 . exprs
384385 . iter ( )
386+ . filter ( |( scalar, idx) | {
387+ if let RemoteExpr :: ColumnRef { id, .. } = scalar {
388+ return idx != id;
389+ }
390+ true
391+ } )
385392 . map ( |( scalar, _) | scalar. as_expr ( & BUILTIN_FUNCTIONS ) )
386393 . collect :: < Vec < _ > > ( ) ;
387394
Original file line number Diff line number Diff line change @@ -133,6 +133,11 @@ impl EvalScalar {
133133 let input_schema = self . input . output_schema ( ) ?;
134134 let mut fields = input_schema. fields ( ) . clone ( ) ;
135135 for ( expr, index) in self . exprs . iter ( ) {
136+ if let RemoteExpr :: ColumnRef { id, .. } = expr {
137+ if index == id {
138+ continue ;
139+ }
140+ }
136141 let name = index. to_string ( ) ;
137142 let data_type = expr. as_expr ( & BUILTIN_FUNCTIONS ) . data_type ( ) . clone ( ) ;
138143 fields. push ( DataField :: new ( & name, data_type) ) ;
You can’t perform that action at this time.
0 commit comments