rluvaton commented on code in PR #18921:
URL: https://github.com/apache/datafusion/pull/18921#discussion_r3006009469


##########
datafusion/physical-expr/src/expressions/lambda_variable.rs:
##########


Review Comment:
   I just run into an issue when upgrading to DataFusion 52 internally, and 
this will have the same problem.
   
   `CASE WHEN` expression does column projection as a way of optimization to 
avoid copy unused column, it was added by @pepijnve in:
   - #18329
   
   the way it does that is transforming the tree and finding Column, so if you 
have `array_transform(list, |v| case when v > 1 then 2 when v > 4 then 6 else 
8)` it will use the path with column projection and it will fail to mark this 
as accessing a column and thus, will not work.
   
   make sure the CASE WHEN is similar to my example so it will use that path. 
   
   column you please add 3 tests:
   1. `array_transform` with that case when only on lambda variable
   2. `array_transform` with case when on lambda variable and external column
   3. `array_transform` with only external columns.
   
   
   I've opened a bug, but I just want to make sure we have tests for this:
   



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