apache / apache/datafusion-sqlparser-rs

Unable to parse 'max' for optional precision column with MS Sql dialect

オープン
#1,714 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Rust
スター
3.5k
フォーク
772
平均マージ
4日 9時間
マージ済み PR(30日)
17

説明

The following is a valid MS Sql query, but cannot ne parsed due to the `varbinary` implementation.

Variable character-based columns, `nvarchar` and `varchar`, use a union type `CharacterLength` type that allows for either `IntegerLength` or `Max` values. The `varbinary` implementation needs a similar union, such as `BinaryLength` (reusing `CharacterLength` seems to have a naming mismatch).

```
#[test]
fn parse_ms_sql_varbinary_max(){
let sql = "CREATE TABLE example(VarBinaryMaxCol varbinary(max) not null);";
let parsed = ms().parse_sql_statements(sql);

assert!(parsed.is_ok());
}
```

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

varbinary の実装から始め、issue に記載されている CharacterLength の処理と比較してください。提供されている parse_ms_sql_varbinary_max テストを実行してください。varbinary(max) を含む MS SQL CREATE TABLE 文が正常に解析されれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
rust
領域
databases
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
55/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。