Skip to content

[CALCITE-7453] Preserve duplicate output names through star expansion and report resulting ambiguity correctly#4847

Open
nirmal-e6 wants to merge 1 commit intoapache:mainfrom
nirmal-e6:fix/ambiguous-duplicate-columns
Open

[CALCITE-7453] Preserve duplicate output names through star expansion and report resulting ambiguity correctly#4847
nirmal-e6 wants to merge 1 commit intoapache:mainfrom
nirmal-e6:fix/ambiguous-duplicate-columns

Conversation

@nirmal-e6
Copy link
Copy Markdown

Jira Link

CALCITE-7453

Changes Proposed

  • Preserve duplicate visible output names during SELECT * expansion instead of uniquifying them.
  • Carry exact source-field metadata for star-expanded duplicate columns so later validation and conversion do not rebind by name to the wrong field.
  • Use that exact metadata in qualification, type derivation, rolled-up column checks, ORDER BY resolution, and SqlToRel field access.
  • Report ambiguity when preserved duplicate output names make outer references genuinely ambiguous.
  • Update affected validator, converter, runtime, and baseline tests to reflect preserved duplicate names and corrected EXPR$N ordinals.

@nirmal-e6 nirmal-e6 force-pushed the fix/ambiguous-duplicate-columns branch from c940123 to 6a8d929 Compare March 26, 2026 07:55
@caicancai caicancai added the discussion-in-jira There's open discussion in JIRA to be resolved before proceeding with the PR label Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

discussion-in-jira There's open discussion in JIRA to be resolved before proceeding with the PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants