Skip to content

fix(syntax): leave out a create source when the statement names none - #233

Merged
kvlonge merged 2 commits into
mainfrom
fix/create-source-absent
Nov 15, 2026
Merged

kvlonge merged 2 commits into
mainfrom
fix/create-source-absent

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

Why

A Snowflake CREATE with no source clause, such as an integration or a policy written without AS, CLONE or FROM SHARE, wrote "source":"" into its tree. That is an invented value for a clause the SQL never had, the same kind of defect as the empty names and ALTER actions already removed. The previous PR counted forms with it as verified and named it as a known defect.

Changes

  • fix(syntax): CreateObject.source is left out of the tree when empty, like the node's other optional parts. A create from a share still records SHARE.
  • chore(syntax-coverage): the 131 approved forms whose trees changed were read again on the fixed trees (scoped: same definitions, obligations and cases). 130 stay approved; the baseline is re-recorded.

Verification

  • A projection test checks an integration and a policy write no source and a create from a share keeps it; it fails on the previous code.
  • 4,837 of the changed cases had an earlier tree dump; each equals the new tree once "source":"" is removed.
  • Verified forms 2,964 to 2,963: gross 0, drops 1, net -1. The drop is CREATE DATA MOVEMENT RULE, rejected for an older defect this change did not cause: MAX_ROWS AS ( ) RETURNS INTEGER -> ( 1 ) keeps only the body.
  • syntax-coverage diff exits 0; make check-ci passes on the final head.

A CREATE with no source clause, such as an integration or a policy
written without AS, CLONE, FROM SHARE or the like, wrote "source": ""
into its tree: an invented value for a clause the SQL never had. The
field is now left out of the tree when empty, the way the other optional
parts of the node already are, and a create from a share still records
its source keyword.
…te trees lost the empty source

Leaving out an empty create source changed the parse trees of 131
approved forms and nothing else in them. Their changed trees were read
again: 130 stay approved. CREATE DATA MOVEMENT RULE stays unreviewed,
because its MAX_ROWS value keeps only the body and drops the written
signature and RETURNS type. The baseline is re-recorded.
@kvlonge
kvlonge enabled auto-merge November 15, 2026 02:07
@kvlonge
kvlonge added this pull request to the merge queue Nov 15, 2026
Merged via the queue into main with commit 5a69e2f Nov 15, 2026
9 checks passed
@kvlonge
kvlonge deleted the fix/create-source-absent branch November 15, 2026 03: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