jonahgao opened a new pull request, #11333: URL: https://github.com/apache/datafusion/pull/11333
## Which issue does this PR close? <!-- We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123. --> Closes #11269. Closes #11275. ## Rationale for this change The bug occurs at the [`new_indices_for_join_filter`](https://github.com/apache/datafusion/blob/f5e114e4f754c81d332f5105dd0242ab13f29a51/datafusion/core/src/physical_optimizer/projection_pushdown.rs#L1219) function within the `ProjectionPushdown` rule. It uses the column name to search for the join filter's columns from `projection_exprs`. https://github.com/apache/datafusion/blob/f5e114e4f754c81d332f5105dd0242ab13f29a51/datafusion/core/src/physical_optimizer/projection_pushdown.rs#L1218-L1220 The problem is that different columns may have the same names, leading to incorrect column matching and generating erroneous physical plans. ## What changes are included in this PR? Use column index for matching. ## Are these changes tested? Yes ## Are there any user-facing changes? No -- 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]
