apache / apache/datafusion-sqlparser-rs

ClickHouse dialect should not require interval qualifier

未关闭 适合新手
#2,390 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Rust
星标
3.5k
派生
772
平均合并
4 天 9 小时
30 天内合并 PR
17

描述

When the `require_interval_qualifier` dialect option was added (https://github.com/apache/datafusion-sqlparser-rs/pull/1398), the main concern was PostgreSQL. Modern clickhouse supports all of:

unquoted intervals

```
SELECT INTERVAL 1 DAY;

┌─toIntervalDay(1)─┐
1. │ 1 │
└──────────────────┘
```

quoted intervals

```
SELECT INTERVAL '1 d';

┌─toIntervalDay(1)─┐
1. │ 1 │
└──────────────────┘
```

Mixed intervals

```
SELECT INTERVAL '1 2:3:4' DAY TO SECOND;

┌─(toIntervalDay(1), toIntervalHour(2), toIntervalMinute(3), toIntervalSecond(4))─┐
1. │ (1,2,3,4) │
└─────────────────────────────────────────────────────────────────────────────────┘
```

---

The fix should be as simple as flipping one boolean [here](https://github.com/apache/datafusion-sqlparser-rs/blob/bf1741bee2acb8013660de21d314533fe5686e93/src/dialect/clickhouse.rs#L47-L49)

贡献指南

这个仓库没有索引到贡献指南

调研方向

打开 src/dialect/clickhouse.rs,定位到 require_interval_qualifier 设置并检查现有的布尔值。调整该设置,使 ClickHouse 接受 issue 中所示的未加引号、加引号和混合 interval;当这三个示例不再需要 interval qualifier 时即表示完成。

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

评估

技术栈
clickhouse, rust
领域
databases
Issue 类型
缺陷
难度
1/5
预计耗时
1 小时以内
活跃度
冷清
描述清晰度
描述清楚
新手友好度
88/100

把新 issue 发到你的邮箱

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