Repository navigation
Conversation
Migration query shapes and fingerprints, raw diff query shapes, relation names, fixture star keys and Snowflake's metadata-only CREATE now parse a native dialect's SQL with SQLQuack, and keep Polyglot only on the legacy route. SQL the native parser cannot read whole gets no proof, so the planner takes its conservative path. Cursor types parse unknown warehouse types with SQLQuack's parser. NativeDialect gains parse, and read_whole becomes a provided method over it, as the analysis route's follow-up defines them.
Fallback per proof
Differences from the Polyglot pathThese come from a before/after run over the 716 compiled ClickHouse model bodies in SQLBuild's e2e projects and seed corpus, plus 137 warehouse type spellings. "Before" is this branch's base with every proof on Polyglot; "after" is this branch.
|
…native # Conflicts: # crates/sqlbuild-analysis/src/analysis_route/constants.rs
…r aliases Repin SQLQuack to the ClickHouse parser that reads TRUNCATE, OPTIMIZE, CREATE TEMPORARY TABLE, ALTER ... DELETE/UPDATE and INTO OUTFILE, so the P008 check and the runtime relation guard read the relation names Polyglot read for them. Forms the parser still gaps keep the existing cannot-parse answer. A star qualifier that names several relations in one query, such as an alias reused across UNION branches or CTEs, now selects every relation it names, keeping star keys a superset of what each star reads. The native star-key walk moves into a helper, the Polyglot parse in the migration proofs returns to its original lines, the unused Polyglot type argument reader is removed, and the tests take fensu's case form.
Python-node SQL: relation names before and afterThe scheduler review found that ClickHouse Python-node SQL the native parser gapped gave no relation names, so the P008 check and the runtime relation guard skipped it. The ClickHouse parser now reads those statements, and this branch pins it. The run calls
The 4 Python-node statements ClickHouse refuses are DuckDB's Accepted forms that still give no names (named in the release note; their check is skipped, as for unreadable SQL):
Reading the first group needs a The 2 other differences:
Other fixes since round 1
|
Repin to the reviewed parser headSQLQuack is now pinned to 7e5e1b1d. Its ClickHouse parser also refuses a plain three-part table in Python-node relation names at this head, against the base:
The release note now also names
|
|
Closed because its base, wip/analysis-route-clickhouse, is a ClickHouse arm superseded by wip/native-cutover's arm. The branch is kept; a fresh PR will follow once it is rebased onto the cutover's arm. |
Draft, stacked on the ClickHouse analysis-route arm; it moves onto the analysis route's follow-up branch once that exists.
Why
The planner's proofs parse SQL with Polyglot directly. These are migration shapes and rename fingerprints, raw diff queries, relation names, fixture star keys, Snowflake's metadata-only CREATE, and cursor types. Each proof has to choose its parser through
analysis_route, as model analysis does. Unreadable SQL gives no proof and the conservative plan.Changes
NativeDialectgainsparse.read_wholebecomes a provided method over it, which refuses gaps, more than one statement, and a loneCommand.analysis_route(dialect). A native route reads SQLQuack's tree, and the legacy route keeps the Polyglot code unchanged. A comment has the per-proof fallback table.TRUNCATE,OPTIMIZE,CREATE TEMPORARY TABLE,ALTER … DELETE/UPDATEandINTO OUTFILE, for relation names in Python-node SQL.Release note:
SETTINGS,FORMATorINTO OUTFILEafterALTER,TRUNCATEorOPTIMIZE;IN PARTITION;DEDUPLICATE BY; andTRUNCATEof a database, ofTABLES FROM, or of a temporary table. The full list is in a comment.OPTIMIZEandALTER … UPDATEread as commands naming no relation, as with Polyglot, so their names are not checked.Verification
cargo test -p sqlbuild-analysis, clippy-D warnings, fensu and the Python planner and relation-guard suites.