gstvg opened a new issue, #22091:
URL: https://github.com/apache/datafusion/issues/22091

   ### Describe the bug
   
   Async udfs are removed from their original position and evaluated within a 
dedicated execution plan, where lambda variables children of the async udf 
aren't available. For example, `select array_transform([-2], v -> 
async_abs(v))` is planned into: 
   
   ```
   logical_plan
   01)Projection: array_transform(List([-2]), (v) -> async_abs(v)) AS 
array_transform(make_array(Int64(-2)),(v) -> async_abs(v))
   02)--EmptyRelation: rows=1
   physical_plan
   01)ProjectionExec: expr=[array_transform([-2], (v) -> __async_fn_0@0) as 
array_transform(make_array(Int64(-2)),(v) -> async_abs(v))]
   02)--RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1
   03)----AsyncFuncExec: async_expr=[async_expr(name=__async_fn_0, 
expr=async_abs(v@0))]
   04)------PlaceholderRowExec
   ```
   
   The `async_abs(v@0)` in `AsyncFuncExpr` contains a lambda variable `v@0` 
which isn't available there
   
   ### To Reproduce
   
   `SELECT array_transform([1], v -> async_udf(v))`
   
   ### Expected behavior
   
   Async udfs should work normally regardless of using lambda variables or not
   
   ### Additional context
   
   Async UDFs PR #14837 
   Higher-order function PR #21679 


-- 
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