Redshift dialect: `[...]` after an expression is a subscript, not a quoted identifier
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 半日
- 初心者へのやさしさ
- 50/100
調査の方向性
Start from RedshiftSqlDialect and find where the tokenizer or dialect treats [ as the start of a delimited identifier. Run the query from the issue through the parser and confirm that the Word comes back with quote_style: Some('[') and the bracket contents as its value. Done means that [ after an expression parses as a subscript in the Redshift dialect, while bracket-quoted identifiers still work in dialects that use them, and a regression test covers the case.
索引モデルが issue の本文から書いたものです。
説明
RedshiftSqlDialect accepts [ as a delimited identifier quote. In Redshift, brackets after an expression index into a SUPER value, and identifiers are quoted only with double quotes.
select a[pg_backend_pid() - pg_backend_pid()] from (select json_parse('[1,2]') as a)
- sqlparser 0.64.0:
Word { value: "pg_backend_pid() - pg_backend_pid()", quote_style: Some('[') }; parses asSELECT a AS [pg_backend_pid() - pg_backend_pid()] FROM .... - Redshift: returns
a = 1, i.e.a[0], so the bracket contents ran as an expression.
Docs: SUPER navigation (https://docs.aws.amazon.com/redshift/latest/dg/query-super.html) and identifier rules (https://docs.aws.amazon.com/redshift/latest/dg/r_names.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 日以内に返信