Redshift dialect: `regtype 'int4'` parses as a column with an alias, not a typed literal
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 48/100
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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).
- 主要言語
- Rust
- スター
- 3.5k
- フォーク
- 805
- 平均マージ
- 2日 3時間
- マージ済み PR(30日)
- 116
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/datafusion-sqlparser-rs のほかの issue
-
Redshift
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
apache/datafusion-sqlparser-rs#2959 ·
メンテナーはふだん 1 日以内に返信
-
Redshift
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
apache/datafusion-sqlparser-rs#2958 ·
メンテナーはふだん 1 日以内に返信
-
PostgreSQL
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
apache/datafusion-sqlparser-rs#2862 ·
メンテナーはふだん 1 日以内に返信
-
PostgreSQL
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
apache/datafusion-sqlparser-rs#2861 ·
メンテナーはふだん 1 日以内に返信
-
PostgreSQL
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
apache/datafusion-sqlparser-rs#2858 ·
メンテナーはふだん 1 日以内に返信
apache/datafusion-sqlparser-rs の issue をすべて見る
似ている issue
-
area:schema documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
ElectronicWave/Elemental#252 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
dekobon/big-code-analysis#1887 ·
メンテナーはふだん 1 日以内に返信
-
Shell中文符号输入异常オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信