apache / apache/datafusion-sqlparser-rs

Snowflake: TIMESTAMP precision regression

未关闭
#1,861 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Rust
星标
3.5k
派生
772
平均合并
4 天 9 小时
30 天内合并 PR
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 wrapper 重现失败的查询 `create table hello(test timestamp_ntz(6))`,并跟踪 Snowflake 时间戳类型的解析过程。完成标准是:精度值从 0 到 9 的各种 timestamp 都能成功解析,同时不会导致无参数 timestamp 出现回归。

由索引模型根据 Issue 内容生成。

评估

技术栈
python, rust, sql
领域
databases
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
38/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。