andygrove opened a new pull request, #2874: URL: https://github.com/apache/datafusion-ballista/pull/2874
# Which issue does this PR close? Closes #2873. # Rationale for this change `PropagateEmptyExecRule` must not null-pad a join that carries an embedded projection (#2200). `as_join` read that from `HashJoinExec`, but hard-coded `has_projection: false` for `SortMergeJoinExec`. Since DataFusion 56 a sort-merge join can carry an embedded projection too, so with `prefer_hash_join=false` a `LEFT JOIN` against an empty table could return a left column where the query asked for a right one, or fail the replan with a schema mismatch. See #2873 for a repro. # What changes are included in this PR? - `as_join` sets `has_projection` from `SortMergeJoinExec::projection`. - Unit tests mirroring the hash-join ones: a `Left` and a `LeftAnti` sort-merge join with an embedded projection and an empty right side stay as they are (both fail without the fix), and an `Inner` one still becomes an `EmptyExec`. # Are there any user-facing changes? No API changes. Queries that hit this case now return the right rows. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
