@@ -69,11 +69,11 @@ impl ExprPlanner for NestedFunctionPlanner {
6969 // TODO: concat function ignore null, but string concat takes null into consideration
7070 // we can rewrite it to concat if we can configure the behaviour of concat function to the one like `string concat operator`
7171 } else if left_list_ndims == right_list_ndims {
72- return Ok ( PlannerResult :: Planned ( array_concat ( vec ! [ left, right] ) ) ) ;
72+ return Ok ( PlannerResult :: Planned ( Box :: new ( array_concat ( vec ! [ left, right] ) ) ) ) ;
7373 } else if left_list_ndims > right_list_ndims {
74- return Ok ( PlannerResult :: Planned ( array_append ( left, right) ) ) ;
74+ return Ok ( PlannerResult :: Planned ( Box :: new ( array_append ( left, right) ) ) ) ;
7575 } else if left_list_ndims < right_list_ndims {
76- return Ok ( PlannerResult :: Planned ( array_prepend ( left, right) ) ) ;
76+ return Ok ( PlannerResult :: Planned ( Box :: new ( array_prepend ( left, right) ) ) ) ;
7777 }
7878 } else if matches ! (
7979 op,
@@ -88,10 +88,10 @@ impl ExprPlanner for NestedFunctionPlanner {
8888 if left_list_ndims > 0 && right_list_ndims > 0 {
8989 if op == sqlparser:: ast:: BinaryOperator :: AtArrow {
9090 // array1 @> array2 -> array_has_all(array1, array2)
91- return Ok ( PlannerResult :: Planned ( array_has_all ( left, right) ) ) ;
91+ return Ok ( PlannerResult :: Planned ( Box :: new ( array_has_all ( left, right) ) ) ) ;
9292 } else {
9393 // array1 <@ array2 -> array_has_all(array2, array1)
94- return Ok ( PlannerResult :: Planned ( array_has_all ( right, left) ) ) ;
94+ return Ok ( PlannerResult :: Planned ( Box :: new ( array_has_all ( right, left) ) ) ) ;
9595 }
9696 }
9797 }
@@ -104,7 +104,7 @@ impl ExprPlanner for NestedFunctionPlanner {
104104 exprs : Vec < Expr > ,
105105 _schema : & DFSchema ,
106106 ) -> Result < PlannerResult < Vec < Expr > > > {
107- Ok ( PlannerResult :: Planned ( make_array ( exprs) ) )
107+ Ok ( PlannerResult :: Planned ( Box :: new ( make_array ( exprs) ) ) )
108108 }
109109
110110 fn plan_make_map ( & self , args : Vec < Expr > ) -> Result < PlannerResult < Vec < Expr > > > {
@@ -117,20 +117,20 @@ impl ExprPlanner for NestedFunctionPlanner {
117117 let keys = make_array ( keys. into_iter ( ) . map ( |( _, e) | e) . collect ( ) ) ;
118118 let values = make_array ( values. into_iter ( ) . map ( |( _, e) | e) . collect ( ) ) ;
119119
120- Ok ( PlannerResult :: Planned ( Expr :: ScalarFunction (
120+ Ok ( PlannerResult :: Planned ( Box :: new ( Expr :: ScalarFunction (
121121 ScalarFunction :: new_udf ( map_udf ( ) , vec ! [ keys, values] ) ,
122- ) ) )
122+ ) ) ) )
123123 }
124124
125125 fn plan_any ( & self , expr : RawBinaryExpr ) -> Result < PlannerResult < RawBinaryExpr > > {
126126 if expr. op == sqlparser:: ast:: BinaryOperator :: Eq {
127- Ok ( PlannerResult :: Planned ( Expr :: ScalarFunction (
127+ Ok ( PlannerResult :: Planned ( Box :: new ( Expr :: ScalarFunction (
128128 ScalarFunction :: new_udf (
129129 array_has_udf ( ) ,
130130 // left and right are reversed here so `needle=any(haystack)` -> `array_has(haystack, needle)`
131131 vec ! [ expr. right, expr. left] ,
132132 ) ,
133- ) ) )
133+ ) ) ) )
134134 } else {
135135 plan_err ! ( "Unsupported AnyOp: '{}', only '=' is supported" , expr. op)
136136 }
@@ -150,7 +150,7 @@ impl ExprPlanner for FieldAccessPlanner {
150150 match field_access {
151151 // expr["field"] => get_field(expr, "field")
152152 GetFieldAccess :: NamedStructField { name } => {
153- Ok ( PlannerResult :: Planned ( get_field ( expr, name) ) )
153+ Ok ( PlannerResult :: Planned ( Box :: new ( get_field ( expr, name) ) ) )
154154 }
155155 // expr[idx] ==> array_element(expr, idx)
156156 GetFieldAccess :: ListIndex { key : index } => {
@@ -167,40 +167,40 @@ impl ExprPlanner for FieldAccessPlanner {
167167 null_treatment,
168168 } ,
169169 } ) if is_array_agg ( & func) => Ok ( PlannerResult :: Planned (
170- Expr :: AggregateFunction ( AggregateFunction :: new_udf (
170+ Box :: new ( Expr :: AggregateFunction ( AggregateFunction :: new_udf (
171171 nth_value_udaf ( ) ,
172172 args. into_iter ( ) . chain ( std:: iter:: once ( * index) ) . collect ( ) ,
173173 distinct,
174174 filter,
175175 order_by,
176176 null_treatment,
177- ) ) ,
177+ ) ) ) ,
178178 ) ) ,
179179 // special case for map access with
180180 Expr :: Column ( ref c)
181181 if matches ! ( schema. data_type( c) ?, DataType :: Map ( _, _) ) =>
182182 {
183- Ok ( PlannerResult :: Planned ( Expr :: ScalarFunction (
183+ Ok ( PlannerResult :: Planned ( Box :: new ( Expr :: ScalarFunction (
184184 ScalarFunction :: new_udf (
185185 get_field_inner ( ) ,
186186 vec ! [ expr, * index] ,
187187 ) ,
188- ) ) )
188+ ) ) ) )
189189 }
190- _ => Ok ( PlannerResult :: Planned ( array_element ( expr, * index) ) ) ,
190+ _ => Ok ( PlannerResult :: Planned ( Box :: new ( array_element ( expr, * index) ) ) ) ,
191191 }
192192 }
193193 // expr[start, stop, stride] ==> array_slice(expr, start, stop, stride)
194194 GetFieldAccess :: ListRange {
195195 start,
196196 stop,
197197 stride,
198- } => Ok ( PlannerResult :: Planned ( array_slice (
198+ } => Ok ( PlannerResult :: Planned ( Box :: new ( array_slice (
199199 expr,
200200 * start,
201201 * stop,
202202 Some ( * stride) ,
203- ) ) ) ,
203+ ) ) ) ) ,
204204 }
205205 }
206206}
0 commit comments