alamb commented on code in PR #9096:
URL: https://github.com/apache/arrow-datafusion/pull/9096#discussion_r1474233579


##########
datafusion/core/src/physical_optimizer/projection_pushdown.rs:
##########
@@ -916,7 +916,9 @@ fn update_expr(
                     .find_map(|(index, (projected_expr, alias))| {
                         
projected_expr.as_any().downcast_ref::<Column>().and_then(
                             |projected_column| {
-                                
column.name().eq(projected_column.name()).then(|| {
+                                (column.name().eq(projected_column.name())

Review Comment:
   There is another similar check a bit further down in the file in 
`new_columns_for_join_on`
   
   
https://github.com/apache/arrow-datafusion/blob/c9049eda85683d958a39eca5fd3a382943ee7fa6/datafusion/core/src/physical_optimizer/projection_pushdown.rs#L1046
   
   Likewise in new_indices_for_join_filter
   
   
https://github.com/apache/arrow-datafusion/blob/c9049eda85683d958a39eca5fd3a382943ee7fa6/datafusion/core/src/physical_optimizer/projection_pushdown.rs#L1132
   
   I wonder if those checks need to extended to check the index as well? Maybe 
we could extract the "find matching projection column" logic as a function 🤔 
   



-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to