Skip to content

fix(syntax-snowflake): represent the part a..b leaves out as null with a flag on its owner - #229

Merged
kvlonge merged 3 commits into
mainfrom
feat/syntax-omitted-parts
Nov 14, 2026
Merged

kvlonge merged 3 commits into
mainfrom
feat/syntax-omitted-parts

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Why

A Snowflake name such as d1..orders, d1..f() or CALL d1..cls!m() leaves its schema out. The tree held an invented empty name in that place, which review criterion (d) rejects, or shifted the parts so the name read as d1.orders.

Changes

  • A table reference keeps schema null and sets schema_omitted. SHOW targets, data metric function names and EXECUTE JOB values use the same table reference.
  • d1..f() is a qualified method call on d1 with schema_omitted.
  • A CALL name keeps the omitted position in place as a null entry: Call.name is now Vec<Option<Identifier>>, rather than a separate index field.
  • Lineage, lint, call spelling keys and parser checks keep the empty part when they join names, so d1..orders never reads as d1.orders. The converter refuses d1..orders; mapping it to d1.PUBLIC.orders is out of scope.
  • Re-reviews of the 276 forms whose trees changed, under review brief version 1 with the clarification that a part a..b leaves out is null with an *_omitted flag on its owner. The frozen brief file is unchanged; each review note records the clarification.

Coverage: verified 2757 to 2768. Gross 16, drops 5, net +11. No drop comes from an a..b tree; each is an existing defect the re-read found:

  • <account_name> obligation filed as an identifier while its case passes a string (2)
  • ON ( , x -> ... ) drops its empty leading slot (2)
  • a catalogue entry missing the second documented Syntax block (1)

Verification

  • Tree test for each owner: table reference, SHOW target, data metric function, EXECUTE JOB value, CALL name list and method call. A spelling-key test fails without the fix. An analyze test checks that d1.orders converts and d1..orders is refused.
  • Tree dump of all 391 a..b evidence cases: no verdict changes and no "name":"" left from a..b.
  • Crate tests for the syntax, Snowflake, DuckDB, semantics, lint and convert crates, plus make check-ci.

…h a flag on its owner

A Snowflake name such as `d1..orders` or `d1..f()` leaves its schema out.
The tree used to hold an invented empty name in that place, or shifted the
remaining parts so the name read as `d1.orders`.

- A table reference keeps `schema` null and sets `schema_omitted`.
- `d1..f()` is a qualified method call on `d1` with `schema_omitted`.
- A CALL name list keeps the omitted position in place as a null entry
  (`Call.name` is now a list of optional identifiers).
- Lineage, lint and the remaining parser checks keep the empty part when
  they join name parts, so `d1..orders` never resolves as `d1.orders`.
- The converter refuses `d1..orders`: the new flag is not one it
  understands.
…ut its schema

A call's spelling key joined its qualifier and method name, so
`SNOWFLAKE..NULL_COUNT( ... )` now keyed as `SNOWFLAKE.NULL_COUNT`, a
two-part name. The key keeps the empty part again. The a..b tree test
also covers a data metric function name and an EXECUTE JOB value.
… trees changed

The forms with a name that leaves out its schema were read again under
review brief version 1, with the clarification that a part a..b leaves
out is null with a `*_omitted` flag on its owner. 267 forms are
approved; the baseline is re-recorded.
@kvlonge
kvlonge enabled auto-merge November 14, 2026 09:18
@kvlonge
kvlonge added this pull request to the merge queue Nov 14, 2026
Merged via the queue into main with commit 53d1419 Nov 14, 2026
9 checks passed
@kvlonge
kvlonge deleted the feat/syntax-omitted-parts branch November 14, 2026 10:22
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