datafusion
datafusion copied to clipboard
Resolve empty relation opt for the remaining join types
Which issue does this PR close?
If successful, Closes #10967
Rationale for this change
Currently the PropagateEmptyRelation relation doesn't optimize all join types This draft proposes to resolve following remaining cases:
- For LeftOut/Full Join, if the right side is empty, the Join can be eliminated with a Projection with left side columns + right side columns replaced with null values.
- For LeftOut/Full Join, if the right side is empty, the Join can be eliminated with a Projection with left side columns + right side columns replaced with null values.
Currently we don't know exactly if these solutions work.
What changes are included in this PR?
- Add match statements for those cases
- SLT & unit Tests
- some final reworks
Are these changes tested?
Yes
Are there any user-facing changes?
No