Repository navigation
feat: built-in Snowflake performance rules for JSON copied onto finer rows - #1515
Merged
Merged
Conversation
…nto the rows flattened from it
…d integration test
# Conflicts: # crates/sqlbuild-rules/src/rules/_helpers/dispatch/catalogue.rs
github-merge-queue
Bot
removed this pull request from the merge queue due to a conflict with the base branch
Nov 16, 2026
# Conflicts: # fensu.toml
SQBRPERFORMANCE102 compares models across the project, so a Snowflake compile that selects it never takes the delta path. Selecting it in the shared dense project made the delta edit loop and the base/head edit ratio measure full compiles. The default dense selection is back to the one main uses, and only the all-rules cold benchmark and the varied benchmark select both performance rules.
Selecting the rule on the Snowflake dialect makes every edit compile the whole project. The compile page lists it among the full-compile cases and the performance rules page says so where it explains selecting the rules. A delta compile test covers both sides: the rules selected on DuckDB keep the delta, and on Snowflake the fallback names SQBRPERFORMANCE102.
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
Two Snowflake checks for JSON duplicated across rows were only custom Python rules.
Changes
SQBRPERFORMANCEfamily, Snowflake only, off by default; select each rule by code.SQBRPERFORMANCE101flags an output column copying a FLATTENvaluewhole when a deeper FLATTEN in the same query reads its child array.SQBRPERFORMANCE102flags a semi-structured output column read from an input with a coarser declared unique key. Exempt: models read only by published views of their entity.--verboselists them).sqlbuild-python-base) for 102's lineage, keys and note.Ticket interpretations:
o.valueitself, through casts, conversions orOBJECT_CONSTRUCT/OBJECT_INSERT/ARRAY_CONSTRUCT. Paths, other functions andIFFare not.OBJECT_DELETEpasses only when it removes the key the deeper FLATTEN reads.VARIANT,OBJECTorARRAY. JSON inVARCHARis not detected.uniquecolumns, mergeunique_key, one-row seeds). Unkeyed models and aggregates are not checked; a model key covered by an input key exempts it. Every reader must be such a view.Verification
VARIANT, repeated per line.make check-cipasses. Large-project comparison with the reference rules remains open.DuckShop: new
edge_cases/performance_rulesfixture.