Redshift dialect: `regtype 'int4'` parses as a column with an alias, not a typed literal
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đá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
- 48/100
Hướng nghiên cứu
The bug is in how the parser decides between a typed string literal and an alias, so start where it handles the Regclass type, which already parses as a typed string. Check how the Redshift dialect is gated, then run select regtype 'int4', select regproc 'version' and select regclass 'pg_user' under that dialect to compare. Done when the first two parse as typed literals with the expected type and the existing parser tests still pass.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Redshift, like Postgres, accepts the generic typed-literal form type 'string' for any type name. sqlparser parses it as a typed string only for types it knows, such as regclass. For other type names it reads the type as a column and the string as an alias.
select regtype 'int4'
- sqlparser 0.64.0:
ExprWithAlias { expr: Identifier("regtype"), alias: Ident { value: "int4", quote_style: Some('\'') } }, i.e. the columnregtypealiased as'int4'. - Redshift: one row,
integer, i.e. the literal'int4'cast toregtype.
Other forms behave the same way: select "regtype" 'int4' returns integer and select regproc 'version' returns version on Redshift, while sqlparser parses both as aliased columns. select regclass 'pg_user' already parses as a typed string because sqlparser has a Regclass data type.
Postgres documents the syntax under "Constants of Other Types" (https://www.postgresql.org/docs/8.0/sql-syntax.html#SQL-SYNTAX-CONSTANTS-GENERIC), and Redshift is based on PostgreSQL 8.0.2 (https://docs.aws.amazon.com/redshift/latest/dg/c_redshift-and-postgres-sql.html).
- 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
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/datafusion-sqlparser-rs
-
Redshift
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
apache/datafusion-sqlparser-rs#2959 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Redshift
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
apache/datafusion-sqlparser-rs#2958 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
PostgreSQL
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
apache/datafusion-sqlparser-rs#2862 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
PostgreSQL
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
apache/datafusion-sqlparser-rs#2861 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
PostgreSQL
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
apache/datafusion-sqlparser-rs#2858 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của apache/datafusion-sqlparser-rs
Issue tương tự
-
area:schema documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
ElectronicWave/Elemental#252 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
dekobon/big-code-analysis#1887 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Shell中文符号输入异常Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày