datafusion
datafusion copied to clipboard
fix: join swap for projected semi/anti joins
Which issue does this PR close?
Closes #10978.
Rationale for this change
On join swap embedded projection for anti/semi joins is getting modified just like for any other join types. This leads to resulting embedded projection, containing column indices out of bounds of join output schema.
What changes are included in this PR?
The fix is not to modify output projection for semi/anti joins -- they already have one-side schema as an output, and trying to add/subtract the number of fields from the other input side to column indices will break the projection.
Are these changes tested?
Existing test for swapping join with embedded projection is extended to test all join types.
Are there any user-facing changes?
Swapping inputs for semi/anti joins with embedded projection should start working.