Repository navigation
feat!: compute query fingerprints from SQLQuack tokens - #1348
Merged
Merged
Conversation
Query fingerprints for generic, DuckDB, PostgreSQL, Snowflake and SQLite SQL now come from SQLQuack's lossless tokenizer instead of Polyglot's. Reserved keywords and called names fold case outside name positions; SQLBuild placeholders such as __ref keep their case. BigQuery, Databricks, SQL Server and ClickHouse keep the previous token stream until SQLQuack tokenizes them. BREAKING CHANGE: the first run after upgrading can plan some models as query_changed even though their SQL did not change. On the switched dialects this affects models that call user-defined functions, whose name case now folds like built-in function names. Plan that run: affected incremental and microbatch models whose replay_on_change is bounded or full replay or rebuild, and sqb build --changed reruns them. Models on the default forward policy only warn.
Fold call names after JOIN again; only INTO, TABLE and CTE column lists keep a called name's case.
Check the word before looking for a column list and find each call's closing parenthesis with one stack pass, so deep or unbalanced nesting stays linear.
kvlonge
enabled auto-merge (squash)
November 7, 2026 16:53
kvlonge
disabled auto-merge
November 7, 2026 16:54
kvlonge
enabled auto-merge (squash)
November 7, 2026 16:54
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.
Why
Query fingerprints decide whether a model's SQL changed. They came from Polyglot's tokenizer, which SQLBuild is removing. SQLQuack now tokenizes DuckDB, PostgreSQL, Snowflake and SQLite, so those dialects and the generic stream move now; the rest switch as their SQLQuack tokenizers land.
Changes
sqlquack-syntaxandsqlquack-syntax-postgresat a pinned git revision. Generic, DuckDB, Snowflake and SQLite readsqlquack-syntax's lossless tokens; PostgreSQL reads the native PostgreSQL scanner, so a later Postgres move does not change hashes again.__placeholders and CTE orINTO/TABLEcolumn-list names keep their case.Verification
__ref.no_changeafter a build; an identifier-case edit is a query change.cargo test -p sqlbuild-analysis, the fingerprint, planner and format-case suites (1,825) andmake check-cipass locally.DuckShop: no new project shape; the change was measured on DuckShop's compiled queries (411 of 412 unchanged).