Skip to content

Fix wildcard keys for USING outer joins - #51

Merged
osipovartem merged 1 commit into
expr-planner-aggregate-schemafrom
full-using-wildcard-coalesce
Sep 2, 2026
Merged

Fix wildcard keys for USING outer joins#51
osipovartem merged 1 commit into
expr-planner-aggregate-schemafrom
full-using-wildcard-coalesce

Conversation

@osipovartem

Copy link
Copy Markdown
Collaborator

Summary

  • preserve the left schema position for unqualified wildcard columns from USING joins
  • use the right key for RIGHT JOIN and coalesce both keys for FULL JOIN
  • keep qualified wildcards and semi/anti joins unchanged

Why

The raw join schema contains one key per side. Wildcard expansion previously removed the duplicate and always retained a single physical column. For a right-only row in a full outer join, that retained left key is null, so SELECT * returned a null join key instead of the right-side value.

Verification

  • cargo test -p datafusion-expr --lib (248 passed)
  • cargo test -p datafusion-sql --test sql_integration (578 passed)
  • cargo test -p datafusion --test core_integration natural_full_join_wildcard_coalesces_join_key
  • cargo clippy -p datafusion-expr -p datafusion-sql --all-targets -- -D warnings
  • cargo clippy -p datafusion --test core_integration -- -D warnings

@osipovartem
osipovartem merged commit cbb778b into expr-planner-aggregate-schema Sep 2, 2026
31 of 33 checks passed
@osipovartem
osipovartem deleted the full-using-wildcard-coalesce branch September 2, 2026 03:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant