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

Đang mở
#2,765 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

  • #2790 của @slopgobblercobbler — đã đóng, không merge

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
68/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
databases

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Rust
Star
3.5k
Fork
805
Merge trung bình
2 ngày 3 giờ
Pull request đã merge (30 ngày)
116

Chuẩn bị môi trường

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của apache/datafusion-sqlparser-rs

Tất cả issue của apache/datafusion-sqlparser-rs

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.