Snowflake: `CREATE DATABASE` and `COPY INTO` consume the `;`, so the next statement is rejected

オープン
#2,765 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

  • #2790 @slopgobblercobbler による — マージされずにクローズ

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
rust
領域
databases

調査の方向性

Start by comparing the Snowflake dialect parsing for CREATE DATABASE and COPY INTO with CREATE SCHEMA, which the issue says already handles a following statement. Read the changes from #1939, #1669, and #1786, and check how the open #2438 handles statement endings. Add regression cases for semicolon-separated statements and confirm both statements parse successfully.

索引モデルが issue の本文から書いたものです。

説明

Prolific Author Snowflake

With SnowflakeDialect, these fail as soon as another statement follows:

CREATE DATABASE my_db; SELECT 1
  -> sql parser error: Expected: end of statement, found: SELECT at Line: 1, Column: 24
CREATE DATABASE my_db COMMENT = 'x'; SELECT 1
COPY INTO t FROM @stage; SELECT 1
  -> same error (on 0.63.0, COPY INTO gives "Expected: =, found: 1 at Line: 1, Column: 33" instead)
CREATE SCHEMA my_s; SELECT 1
  -> 2 statements (fine)

Each statement parses on its own. CREATE DATABASE my_db; SELECT 1 worked in 0.58.0 and broke in 0.59.0 (#1939); COPY INTO has done this since #1669, which fixed #1519 for a trailing ; only. Same class as #1775 (fixed in #1786). Open PR #2438 makes ->> end these statements but leaves the ; case as is.

Tested on main c45d1f4e (also 0.63.0).

Found with a property-based fuzzer (round trip and statement-separation checks); I used AI assistance for triage and verified every case above.

主要言語
Rust
スター
3.5k
フォーク
805
平均マージ
2日 3時間
マージ済み PR(30日)
116

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/datafusion-sqlparser-rs のほかの issue

apache/datafusion-sqlparser-rs の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。