Repository navigation
Commit f7c1e76
authored
feat(rules): run SQL Rules through the SQLClean engine (#1283)
* feat(rules): run SQL Rules through the SQLClean engine (work in progress)
Checkpoint of the SQLClean integration: SQLCLEAN Rule codes, default
rule selection with the human-only notice, shared expansion inputs for
early lint, and SQL Rules skipped under --no-sql-analysis. e2e fixture
classification and Fensu faults are still open.
* feat(rules): finish the SQLClean engine integration
Pin sqlclean to v0.4.1, lint with the compile target and vars, skip
audit and SQL test files that opt out of SQL analysis, skip the row-rule
fact build for SQL-only selections, align fixtures and DuckShop with the
new findings, and update the docs.
* fix(rules): lint with the compiled target and vars, keep format fix eligibility
SQL Rules now expand with the compiled project effective target and vars
on every compile path instead of falling back to the default target when
the early-lint reuse is missing. Commands without target flags use the
project default explicitly. Restore the eight-code format --fix allowlist
and its documented decisions, and cover --target and --vars end to end.
* test(compile): split perf guards into default Rules and compiler-only
Default SQL Rules lint every compiled model, a measured 1.14x to 1.19x
cold wall cost over select = []. Compiler-only cases keep the previous
budgets and the 1.10 same-runner ratio; default-Rules cases scale the
cold budgets by the measured cost. Also pin sqlclean to the PIVOT USING
fix and keep two fixtures' derived tables out of SQLCLEAN039.
* test(compile): keep compiler-only ratios valid after default Rules land
Pass compiler_only to the base generator when the base supports it, so
the compiler-only job keeps both sides without Rules once main runs them.
Mark the default-Rules cold allowance as temporary, reject
--compiler-only with the dense project at parse time, assert that
default-Rules guard cases run Rules, and pin sqlclean to the v0.4.2
release commit.
* test(compile): split the 5,000- and 10,000-model guards for default Rules
Default SQL Rules cost 1.09x on the 10,000-model compile and 1.20x and
1.25x on the 5,000- and 10,000-model cache guards' cold runs, measured
against select = [] on the same machine. Scale those cold budgets and
keep the previous budgets as compiler-only cases, as for 3,000 models.
* test(compile): keep one compiler-only guard and calibrate Rules budgets on CI
Replace the compiler-only twin at every guard size with one paired guard: the
3,000-model cache guard runs default Rules and select = [] in the same job and
covers cold, warm, edit and project-config edit compiles at the previous
budgets. Drop the compiler-only same-runner ratio job and the --compiler-only
option of the ratio script.
Scale each default Rules budget by the larger of the CI same-job and local
alternating medians, excluding pairs whose Rules-independent phases exceed
twice their median. Give the project-config edit its own budget, since it
reruns every rule.
* docs(compile): correct the 5,000-model project-config budget and cold budget scope
The stated method gives 1.24x for the 5,000-model project-config edit, so its
budget is 18.0 s. The cold budget bounds the cold run as well as the
cache-disabled timeout.1 parent c2ccbad commit f7c1e76
296 files changed
Lines changed: 2225 additions & 22938 deletions
File tree
- .github/workflows
- benchmarks
- dbt-compare
- duckshop-10k
- duckshop10k
- duckshop
- project
- models/intermediate/support
- crates
- sqlbuild-analysis
- src
- semantic_validation/_helpers
- sql_tokens
- _helpers
- main
- reserved_keywords
- tests
- sqlbuild-core/src
- cli_text
- main
- tests
- format_command/tests
- sqlbuild-python
- src/bindings/_helpers
- cli
- compile_attachment
- compile_command
- compile_driver
- compiled_views
- records
- rule_records
- rules
- sqlbuild-rules
- src
- configuration/_helpers
- engine
- _helpers
- tests
- lint_text
- _helpers
- main
- tests
- relation_keys
- _helpers
- main
- rule_cache/tests
- rule_catalogue
- main
- rule_results
- main
- tests
- rules
- _helpers
- main
- sql_lint
- _helpers
- main
- tests
- fixtures
- sql_quality
- _helpers
- main
- tests
- scripts
- cold_compile_performance/_helpers
- compile_performance_ratio/main
- compiler_differential
- _helpers
- analysis_corpus
- corpus
- classes
- planner_differential/_helpers/steps
- rules_benchmark/_helpers
- src/sqlbuild
- .agents/skills/sqlbuild/references/docs
- cli
- concepts
- macros
- rules
- tests
- e2e/src/sqlbuild/cli/commands/main
- audit
- build
- clickhouse
- clone
- compile
- fixtures/semantic
- sql_macros
- format
- playground
- rules
- scenario
- sqlite
- test
- goldens/compiler/failure
- integration/src/sqlbuild
- cli
- commands/main
- column_migrations
- compile_outputs
- entry
- recall
- compiler/pipeline
- executor/build
- rule_engine/native_rows
- unit
- scripts/compiler_differential/_helpers/running
- src/sqlbuild
- cli/commands/main
- compile
- entry
- lint
- _helpers
- rule_engine/_helpers/engine
- website/src/content/docs/docs
- cli
- concepts
- macros
- rules
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
671 | 671 | | |
672 | 672 | | |
673 | 673 | | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
674 | 678 | | |
| 679 | + | |
675 | 680 | | |
| 681 | + | |
| 682 | + | |
676 | 683 | | |
677 | 684 | | |
678 | 685 | | |
| |||
746 | 753 | | |
747 | 754 | | |
748 | 755 | | |
| 756 | + | |
| 757 | + | |
749 | 758 | | |
750 | 759 | | |
751 | 760 | | |
752 | 761 | | |
753 | 762 | | |
754 | 763 | | |
| 764 | + | |
| 765 | + | |
755 | 766 | | |
756 | 767 | | |
757 | 768 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| 142 | + | |
| 143 | + | |
142 | 144 | | |
143 | 145 | | |
144 | 146 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
324 | | - | |
| 324 | + | |
325 | 325 | | |
326 | 326 | | |
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
332 | | - | |
| 332 | + | |
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
338 | 338 | | |
339 | 339 | | |
340 | | - | |
| 340 | + | |
341 | 341 | | |
342 | 342 | | |
343 | 343 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
195 | | - | |
196 | | - | |
| 195 | + | |
| 196 | + | |
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
200 | | - | |
| 200 | + | |
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | | - | |
| 228 | + | |
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| |||
0 commit comments