apache / apache/datafusion-sqlparser-rs

Snowflake: TIMESTAMP precision regression

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

説明

For Snowflake time formats support precision parameter ([from Snowflake documentation](https://docs.snowflake.com/en/sql-reference/data-types-datetime#timestamp)):
> All timestamp variations, as well as the TIMESTAMP alias, support an optional precision parameter for fractional seconds (for example, TIMESTAMP(3)). Timestamp precision can range from 0 (seconds) to 9 (nanoseconds). The default precision is 9.

Note: this comes from using Python wrapper sqloxide

Query that fails:
```sql
create table hello(test timestamp_ntz(6))
```

Error:
```
sql parser error: Expected: ',' or ')' after column definition, found: ( at Line: 1, Column: 38
```

removing precision from `timestamp_ntz` passes through

Unfortunately I cannot directly link which version (not visible throughintroduced this regression, but it seems to be recent

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

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

調査の方向性

まず、Python の sqloxide ラッパーを介して失敗するクエリ `create table hello(test timestamp_ntz(6))` を再現し、Snowflake の timestamp 型がどのようにパースされるかを追跡します。精度の値が 0 から 9 までの timestamp のバリエーションが、パラメータ化されていない timestamp にリグレッションを起こさず正常にパースできれば完了です。

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

評価

技術スタック
python, rust, sql
領域
databases
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
38/100

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

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