Skip to content

fix: upgrade Polyglot to 0.12.3 for PIVOT and UNPIVOT star lineage - #784

Merged
kvlonge merged 1 commit into
mainfrom
fix/pivot-lineage-polyglot-0123
Sep 23, 2026
Merged

kvlonge merged 1 commit into
mainfrom
fix/pivot-lineage-polyglot-0123

Conversation

@kvlonge

@kvlonge kvlonge commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Why

Star projections over PIVOT and UNPIVOT sources compiled with the wrong columns. SELECT * FROM cte PIVOT (MAX(amount) FOR category IN ('books', 'games')) reported the pre-pivot customer_id, category, amount instead of customer_id, books, games, and its lineage pointed at the wrong inputs. UNPIVOT over a CTE reported the pre-unpivot columns.

Changes

  • Upgrade the Polyglot fork to 0.12.3 (Rust crate pinned to the fork release commit, Python package polyglot-sql-chio==0.12.3). The release derives star expansion over PIVOT and UNPIVOT sources from the input relation's columns, and leaves the star unexpanded when those columns are unknown.
  • 0.12.3 ships one stable-ABI (cp312-abi3) wheel per platform, so uv.lock lists five wheels instead of one per Python version.
  • New integration test: compiles real projects with PIVOT-over-CTE and UNPIVOT-over-CTE models, and checks compiled columns and lineage against DuckDB's actual result columns.

Verification

  • The new integration test fails on 0.12.2 and passes on 0.12.3.
  • Fork: new table-driven Rust test covering pivot and unpivot shapes in both analysis modes, plus the fork core and query-analysis suites.
  • make check-ci passes, as do the focused lineage and analysis-cache tests.
  • A private real-project paired comparison showed identical artifacts and semantics in all runs, with no timing regression.

@kvlonge
kvlonge enabled auto-merge (squash) September 23, 2026 06:02
@kvlonge
kvlonge merged commit f8d4481 into main Sep 23, 2026
28 checks passed
@kvlonge
kvlonge deleted the fix/pivot-lineage-polyglot-0123 branch September 23, 2026 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant