rkrishn7 opened a new pull request, #17546: URL: https://github.com/apache/datafusion/pull/17546
## 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 https://github.com/apache/datafusion/issues/17511 ## Rationale for this change When building equal conditions in a data source node, we want to ignore any stale references to columns that may have been swapped out (e.g. from `try_swapping_with_projection`). The current code reassigns predicate columns from the filter to refer to the corresponding ones in the updated schema. However, it only ignores non-projected columns. `reassign_predicate_columns` builds an invalid column expression (with index `usize::MAX`) if the column is not projected in the current schema. We don't want to refer to this in the equal conditions we build. ## What changes are included in this PR? Ignores any binary expressions that reference non-existent columns in the current schema (e.g. due to unnecessary projections being removed). ## Are these changes tested? ## Are there any user-facing changes? N/A -- 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...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org