apache / apache/datafusion-sqlparser-rs
Make `CreateTable.location` / `AlterTable.location` make more sense
- 主要言語
- Rust
- スター
- 3.5k
- フォーク
- 772
- 平均マージ
- 4日 9時間
- マージ済み PR(30日)
- 17
説明
`CreateTable.location` has no documentation and is a tricky edge case, not always set even when SQL statement did set location.
https://docs.rs/sqlparser/latest/sqlparser/ast/struct.CreateTable.html#structfield.location
Since this took some time to figure out, here's what I've found for others also pondering its role:
- `CREATE EXTERNAL TABLE .. LOCATION 'foo'` sets `CreateTable.location`
- `CREATE TABLE .. LOCATION 'foo'` sets `CreateTable.hive_formats.location`
- `ALTER TABLE .. LOCATION` sets `AlterTable.location`
- `AlterTable.location` types are about Hive, and is thus a bit confusing for external tables: https://docs.rs/sqlparser/latest/sqlparser/ast/enum.Statement.html#variant.AlterTable.field.location
- alter vs create behaviors thus do not match
Maybe make Hive syntax use the top-level `location` field?
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
まず docs.rs の CreateTable.location、CreateTable.hive_formats.location、AlterTable.location の定義を確認し、次に issue に列挙されている CREATE EXTERNAL TABLE、CREATE TABLE、ALTER TABLE LOCATION 形式について parser の動作を追跡してください。location のセマンティクスが一貫するように実装されるか、明確に文書化され、これらのケースに対するリグレッションテストのカバレッジがあれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- rust, sql
- 領域
- compilers, databases
- issue の種類
- リファクタリング
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 30/100