Skip to content

Fix Unparser for stacked Projections & Expand Unparser tests#21067

Open
cetra3 wants to merge 1 commit intoapache:mainfrom
pydantic:fix-unparser-derived-projection-qualifier
Open

Fix Unparser for stacked Projections & Expand Unparser tests#21067
cetra3 wants to merge 1 commit intoapache:mainfrom
pydantic:fix-unparser-derived-projection-qualifier

Conversation

@cetra3
Copy link
Contributor

@cetra3 cetra3 commented Mar 20, 2026

Which issue does this PR close?

Fixes #21066

Rationale for this change

The Unparser breaks in some certain scenarios, which also don't have test coverage.

What changes are included in this PR?

  • Fix: dequalify outer SELECT columns when wrapping stacked projections as derived subqueries
  • Tests: parameterize unparser roundtrip tests over all dialects + optimized/unoptimized plans, add regression test suite

Are these changes tested?

Yes, they are tested, the majority of this PR is to introduce more test paths.

Are there any user-facing changes?

No breaking changes, but some SQL generated by the Unparser may end up being a little different

@github-actions github-actions bot added sql SQL Planner core Core DataFusion crate labels Mar 20, 2026
@cetra3 cetra3 force-pushed the fix-unparser-derived-projection-qualifier branch from 224a532 to d6d6ec2 Compare March 20, 2026 03:02
@cetra3
Copy link
Contributor Author

cetra3 commented Mar 20, 2026

OK adding the optimized pass and different dialects has actually opened a can of worms for unparser corner & edge cases. I will see if I can work through these in this PR and if not, maybe will need to open a more conservative targeted PR

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

Labels

core Core DataFusion crate sql SQL Planner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unparser with PostgreSqlDialect fails after Optimization Pass

1 participant