gstvg commented on code in PR #21323:
URL: https://github.com/apache/datafusion/pull/21323#discussion_r3180271982


##########
datafusion/expr/src/higher_order_function.rs:
##########
@@ -224,35 +224,104 @@ pub struct LambdaArgument {
     /// per outer sublist), avoiding the per-call `Schema::new` build that
     /// includes constructing the internal name -> index map.
     schema: SchemaRef,
+    /// A RecordBatch containing the captured columns inside this lambda body, 
if any
+    ///
+    /// For example, for `array_transform([2], v -> v + a + b)`,
+    /// this will be a `RecordBatch` with two columns, `a` and `b`
+    captures: Option<RecordBatch>,

Review Comment:
    `ProjectionExprs` can be used if we modify it to also handle 
`LambdaVariable`'s, should we do that?
    I checked all usages I could find and didn't identify none where such 
modification would cause problems, I'm just not sure if we should do it.
   In case you note in next reads of the PR, currently indices of lambda 
variables of inner lambdas are also collected and would cause problems with 
`ProjectionExprs`, but that's easy fixable so please don't take that into 
account when thinking about it



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to