Skip to content

refactor(analysis): read B101 spellings from a recorded table - #1356

Closed
kvlonge wants to merge 4 commits into
mainfrom
refactor/b101-recorded-spellings
Closed

kvlonge wants to merge 4 commits into
mainfrom
refactor/b101-recorded-spellings

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Why

The unknown-function check (B101) asked the SQL library's parser which built-in node each unaccepted call spelling becomes, and took DuckDB's accepted names from the library's function catalogue. Moving SQL analysis off that library needs B101 to stop depending on it.

Changes

  • B101 reads a recorded table of the 41 rejected spellings, each with its argument count and the spelling the dialect accepts (function_spellings.txt). Every DuckDB row was confirmed unknown to DuckDB 2.0.0.
  • The call scan takes the analysis dialect name, so it runs unchanged once analysis no longer uses the library.
  • The workspace no longer depends directly on the library's function-catalogue crate, and the 993-line Snowflake function list is gone. Resolved features are unchanged.

Verification

  • Findings are identical to the old code on every DuckDB and Snowflake query of the compiler differential corpus, and on every candidate spelling at 0 to 9 arguments (144,481 inputs).
  • cargo test -p sqlbuild-analysis passes.
  • make compiler-differential: 391 projects as expected.
  • make test: 12,010 passed. Of 10 failures, 4 need Docker or PostgreSQL, which the local sandbox lacks, and fail the same way on the base commit. 6 are interrupt and signal tests that pass when rerun.
  • make check-ci passes on the merged head.
  • No edge case belongs in DuckShop: B101 depends only on call spellings, and the recorded table is checked against every spelling.

… of SQL library probes

The unknown-function check (B101) asked the SQL library's parser which
built-in node each unaccepted call spelling becomes, and took DuckDB's
accepted names from the library's function catalogue. The check now reads
a table of the 41 rejected spellings, each with its argument count and the
spelling the dialect accepts. Every DuckDB row was confirmed unknown to
DuckDB 2.0.0. The call scan takes the analysis dialect name, so analysis
off the library can run it unchanged.

Findings are identical on every DuckDB and Snowflake query of the compiler
differential corpus and on every candidate spelling at 0 to 9 arguments.
The workspace no longer depends on the library's function-catalogue crate
directly; resolved features are unchanged.
@kvlonge
kvlonge enabled auto-merge (squash) November 7, 2026 20:05
@kvlonge
kvlonge disabled auto-merge November 8, 2026 12:43

kvlonge commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

Folded into the single combined sqlbuild PR (D625/D626), which the SQLBuild lane is assembling now and opens once #1377 lands. Branch kept.

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