@@ -22,7 +22,7 @@ use crate::{ColumnarValue, Documentation, Expr};
2222use arrow:: array:: { ArrayRef , RecordBatch } ;
2323use arrow:: datatypes:: { DataType , FieldRef , Schema } ;
2424use datafusion_common:: config:: ConfigOptions ;
25- use datafusion_common:: { Result , ScalarValue , exec_err , not_impl_err} ;
25+ use datafusion_common:: { Result , ScalarValue , not_impl_err} ;
2626use datafusion_expr_common:: dyn_eq:: { DynEq , DynHash } ;
2727use datafusion_expr_common:: signature:: Volatility ;
2828use datafusion_physical_expr_common:: physical_expr:: PhysicalExpr ;
@@ -208,45 +208,20 @@ pub struct LambdaArgument {
208208 /// For example, for `array_transform([2], v -> -v)`,
209209 /// this will be the physical expression of `-v`
210210 body : Arc < dyn PhysicalExpr > ,
211- /// A RecordBatch with the captured columns inside the lambda body, if any
212- ///
213- /// For example, for `array_transform([2], v -> v + a + b)`,
214- /// this will be a `RecordBatch` with columns `a` and `b`
215- captures : Option < RecordBatch > ,
216211}
217212
218213impl LambdaArgument {
219- /// Create a new LambdaArgument
220- ///
221- /// Note that capture is not supported yet and must be `None` for now,
222- /// otherwise [LambdaArgument::evaluate] will fail
223- pub fn new (
224- params : Vec < FieldRef > ,
225- body : Arc < dyn PhysicalExpr > ,
226- captures : Option < RecordBatch > ,
227- ) -> Self {
228- Self {
229- params,
230- body,
231- captures,
232- }
214+ pub fn new ( params : Vec < FieldRef > , body : Arc < dyn PhysicalExpr > ) -> Self {
215+ Self { params, body }
233216 }
234217
235218 /// Evaluate this lambda
236219 /// `args` should evaluate to the value of each parameter
237220 /// of the correspondent lambda returned in [HigherOrderUDF::lambda_parameters].
238- ///
239- /// `adjust` should adjust the length of captured columns of this
240- /// lambda relative to it's parameters
241221 pub fn evaluate (
242222 & self ,
243223 args : & [ & dyn Fn ( ) -> Result < ArrayRef > ] ,
244- _adjust : impl FnOnce ( & [ ArrayRef ] ) -> Result < Vec < ArrayRef > > ,
245224 ) -> Result < ColumnarValue > {
246- if self . captures . is_some ( ) {
247- return exec_err ! ( "lambda column capture is not supported yet" ) ;
248- }
249-
250225 let columns = args
251226 . iter ( )
252227 . take ( self . params . len ( ) )
0 commit comments