Skip to content

fix(compiler)!: reject unknown schema-change values and follow dialect quoting in compile scanners - #912

Merged
kvlonge merged 7 commits into
mainfrom
fix/small-fixes-batch
Oct 2, 2026
Merged

kvlonge merged 7 commits into
mainfrom
fix/small-fixes-batch

Conversation

@kvlonge

@kvlonge kvlonge commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Why

Several small correctness gaps: unknown on_schema_change/replay_on_change values silently fell back to defaults and dlt_sources accepted unknown keys (CHI-465); compile-step SQL scanners ignored dialect string escapes (CHI-466); quoted source columns caused a false B002 on JOIN USING (CHI-467); compile --json printed nothing when compile stopped on an error (CHI-470); a microbatch overlap test was timing-flaky (CHI-468); the Rules cache reused stale results on development builds (CHI-471).

Changes

  • Breaking: unknown on_schema_change/replay_on_change values fail in headers (P001) and [defaults]/[path_defaults] (D001); unknown dlt_sources keys fail (D006). The planner no longer falls back silently.
  • Compile-step scanners (Python and the native SQL-test planner) follow each adapter's lexical syntax; cache keys include it.
  • JOIN USING columns are encoded once, so quoted source columns no longer trigger B002; capped microbatch fixtures read real source tables again.
  • compile --json prints one JSON document with stopped: true and the error when compile raises.
  • The overlap test waits on a barrier instead of sleeping.
  • Rules cache keys include a native build identity hashed from the crate sources and Cargo.lock.

Verification

  • Unit tests and DuckDB E2E per ticket; each new test fails on the previous code.
  • make test, make check-ci; one independent review (no high or medium findings; low items fixed or tracked in CHI-477).

… dlt_sources keys

Unknown on_schema_change and replay_on_change values fell back to the
default policy, and dlt_sources groups and resources accepted any key.
They now fail compilation: MODEL headers and [defaults]/[path_defaults]
name the value, list the valid ones and show a valid header or TOML line;
dlt keys get the nearest supported key as help. bounded-<duration> must
carry a positive duration. The planner no longer maps unknown values to
a default.

BREAKING CHANGE: unknown on_schema_change or replay_on_change values and
unknown dlt_sources keys now fail compilation.

Refs: CHI-465
Reference extraction, SQL test and scenario CTE scanning, assertion target
detection, scope relationships and native SQL test planning now honour the
active adapter's lexical syntax (backslash escapes, escape and raw string
prefixes, triple quotes, dialect line comments and nested block comments)
instead of generic SQL rules. Cache keys include the lexical syntax.

Refs: CHI-466
…binding

When a relation carries exact (quoted) column names, such as a source table
read from the warehouse, binding encodes every identifier. JOIN USING columns
were encoded twice, once through the SELECT and once through the JOIN node, so
valid joins failed with B002 "JOIN USING column must exist on both sides".

The capped microbatch dependency fixtures read a real source table again.

Refs: CHI-467
… an error

When compile raised an error, such as a header parse failure, --json wrote
nothing to stdout. It now prints one JSON document with has_errors, stopped,
and the error's code, message and help, matching the stderr text. The exit
code is unchanged and progress stays on stderr.

Refs: CHI-470
…tead of sleeping

The concurrent microbatch test relied on a 50 ms sleep for three delta
stagings to overlap and saw two under load. After each model's serial first
batch, the tracking adapter now holds stagings until three are active, with a
30 s timeout that fails the test with a clear message.

Refs: CHI-468
…sion

Local development builds shared one SQLBuild version, so the Rules cache under
target/rules-cache reused results from older builds until it was cleared. A
build script now hashes the native crate sources and lockfile, and the ruleset
fingerprint, model and custom-rule cache identities, and the SQL rule cache use
the version plus that hash. Released builds keep a stable identity.

Refs: CHI-471
@kvlonge
kvlonge enabled auto-merge (squash) October 2, 2026 18:25
@kvlonge
kvlonge merged commit db5cd56 into main Oct 2, 2026
36 checks passed
@kvlonge
kvlonge deleted the fix/small-fixes-batch branch October 2, 2026 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant