Repository navigation
fix: keep stub-named CTEs from capturing references and the layered benchmark compiling - #880
Merged
Merged
Conversation
The layered generator placed its contract schema in project-wide schemas/ although only the first staging model uses it (S024), and its seed-joined models referenced id unqualified (B003). Place the schema beside its only consumer, qualify input columns, and refresh the stale hook count in the disabled layered performance guard. Add a small non-performance E2E compile of the layered project so the generator cannot silently break again. Refs: CHI-414
Compact analysis without a binding schema replaced relation references with __sqlbuild_project_input_N stubs without checking the authored SQL, so a CTE with that name (any case) captured the reference and analysis inferred the CTE's shape instead of the input's. Share the binding-mode sharing guard and fall back to real relation names when the stub prefix appears in the SQL or a relation name. Refs: CHI-412
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
The layered production benchmark generator no longer produced a compiling project (a schema used only from staging lived at project level, and seed-joined models used ambiguous
id), and nothing caught it because its only consumer runs in a disabled performance job. Separately, compact analysis without a binding schema could let an authored CTE named like an internal relation stub capture relation references.Changes
models/staging/_sqlbuild/_schemas/, seed-joined models qualify their columns; the disabled layered guard's hook expectation matches current generation (0).relation_stubs_collideguard (casefolded prefix in SQL or relation names) now also protects compact non-binding analysis, which falls back to real names.Verification
make test,make check-ci, hygiene scan; one independent review (no findings).