Skip to content

fix(sql): preserve source qualifiers in CTAS with explicit schema#23879

Open
lyne7-sc wants to merge 2 commits into
apache:mainfrom
lyne7-sc:fix-ctas-explicit-schema-qualifiers
Open

fix(sql): preserve source qualifiers in CTAS with explicit schema#23879
lyne7-sc wants to merge 2 commits into
apache:mainfrom
lyne7-sc:fix-ctas-explicit-schema-qualifiers

Conversation

@lyne7-sc

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

CTAS with an explicit schema fails when qualified source columns have the same name because their qualifiers are not preserved.

What changes are included in this PR?

  • Preserve source column qualifiers in the CTAS cast projection.
  • Add a SQL logic test for this case.

Are these changes tested?

Yes.

Are there any user-facing changes?

This is a bug fix with no public API changes.

@github-actions github-actions Bot added sql SQL Planner sqllogictest SQL Logic Tests (.slt) labels Jul 25, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.65%. Comparing base (1c8295c) to head (fae3a8b).
⚠️ Report is 41 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #23879      +/-   ##
==========================================
- Coverage   80.75%   80.65%   -0.11%     
==========================================
  Files        1089     1091       +2     
  Lines      368809   371031    +2222     
  Branches   368809   371031    +2222     
==========================================
+ Hits       297837   299244    +1407     
- Misses      53217    53940     +723     
- Partials    17755    17847      +92     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sql SQL Planner sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CTAS with an explicit schema fails for qualified columns with the same name

2 participants