alamb commented on a change in pull request #1781:
URL: https://github.com/apache/arrow-datafusion/pull/1781#discussion_r801973348



##########
File path: datafusion/src/optimizer/filter_push_down.rs
##########
@@ -346,14 +346,18 @@ fn optimize(plan: &LogicalPlan, mut state: State) -> 
Result<LogicalPlan> {
                 .fields()
                 .iter()
                 .enumerate()
-                .map(|(i, field)| {
+                .flat_map(|(i, field)| {
                     // strip alias, as they should not be part of filters
                     let expr = match &expr[i] {
                         Expr::Alias(expr, _) => expr.as_ref().clone(),
                         expr => expr.clone(),
                     };
 
-                    (field.qualified_name(), expr)
+                    // considering both qualified and unqualified names as 
rewriting option
+                    [
+                        (field.name().clone(), expr.clone()),
+                        (field.qualified_name(), expr),
+                    ]

Review comment:
       Why is this change to `Projection` needed? I tried removing this change 
locally and all the tests still passed 🤔 
   
   Can you add a test case that would fail without this change?




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


Reply via email to