Skip to content

fix(syntax-snowflake): parse a call that leaves out its schema as a qualified call - #230

Merged
kvlonge merged 2 commits into
mainfrom
fix/snowflake-db-call-shape
Nov 14, 2026
Merged

kvlonge merged 2 commits into
mainfrom
fix/snowflake-db-call-shape

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Why

Snowflake's <database>..<function>( ... ) leaves the schema out. The parser stored it as a method call on a column that named the database, with a flag marking the omitted schema. That claims the database is a column and puts the name in a different place from every other qualified call. It should ship as a qualified call before the next release.

Changes

  • db..f( ... ) now parses into the qualified call node, with name [db, null, f], and keeps its arguments. The method call loses its schema_omitted flag. db.s.f( ... ) stays a method call.
  • Spelling keys give the omitted schema an empty part, so SNOWFLAKE..NULL_COUNT keeps its three-part key.
  • Lineage reads only the arguments of a Snowflake <schema>.<function>( ... ) call, so the qualifier is no longer traced as a column. db..f(x) and db.s.f(x) now trace the same way.
  • The converter still refuses db..f( ... ). No schema is guessed.
  • Tests cover the call node's parts, quoted parts, lineage of the three spellings, and the refusal. The 235 verified forms whose trees changed were re-reviewed and are approved again.

Verification

  • Each changed tree was checked mechanically against its old tree: the only change is the method call becoming a qualified call, and the arguments are unchanged. One independent review approved every changed form.
  • Crate tests for the Snowflake syntax and semantics, the CLI convert test and the spelling tests pass.
  • Verified forms stay at 2768.
  • make check-ci passes.

…ualified call

Snowflake's `<database>..<function>( ... )` now parses into the qualified
call node with the name `[database, null, function]`, instead of a method
call on a column that named the database. Spelling keys keep the empty
part. Lineage reads only the arguments of a Snowflake schema-qualified
call, so its qualifier is never traced as a column, and both spellings
trace alike. The converter still refuses the call.
… trees changed

The 235 verified forms with a call that leaves out its schema were read
again for their changed trees only: each call is now a qualified call
whose name keeps the omitted schema as null, with its arguments
unchanged. All are approved; the baseline is re-recorded.
@kvlonge
kvlonge enabled auto-merge November 14, 2026 10:42
@kvlonge
kvlonge added this pull request to the merge queue Nov 14, 2026
Merged via the queue into main with commit 9786cec Nov 14, 2026
9 checks passed
@kvlonge
kvlonge deleted the fix/snowflake-db-call-shape branch November 14, 2026 11:47
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