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


##########
datafusion/physical-expr/src/expressions/case.rs:
##########
@@ -133,6 +133,10 @@ impl CaseBody {
             expr.apply(|expr| {
                 if let Some(column) = expr.as_any().downcast_ref::<Column>() {
                     used_column_indices.insert(column.index());
+                } else if let Some(lambda_variable) =
+                    expr.as_any().downcast_ref::<LambdaVariable>()
+                {
+                    used_column_indices.insert(lambda_variable.index());

Review Comment:
   I'm 98% sure this has a bug for conflicting indices for lambda variable and 
columns, and even if you separate lambda variable indices from the column 
indices you can still have problem with nested lambda variables and using upper 
lambda variable inside nested ones



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