fix(test): replace QUALIFY assertion with dialect-agnostic CASE WHEN … - #24
Merged
Merged
Conversation
…check The QUALIFY keyword is not emitted by the satellite generator — it uses a subquery+WHERE pattern to stay portable across dialects. Using sqlglot's .qualify() to satisfy the test would break Postgres: sqlglot's QUALIFY→subquery rewrite injects duplicate columns (SELECT *, rn, _w) causing an ambiguous column reference error on the incremental path. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
tkirschke
approved these changes
Sep 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix a failing CI test in test_sat_v0_full_load by correcting an over-specific assertion.
Why
The test asserted "QUALIFY" in sql, but the satellite generator intentionally uses a subquery+WHERE pattern for the LAG-based deduplication step — making it work across all dialects. Using sqlglot's native .qualify()
instead would fix the test, but sqlglot's QUALIFY→Postgres transpilation injects duplicate columns (SELECT *, rn, _w) which causes ERROR: column reference "rn" is ambiguous on the incremental path in Postgres.
Changes