apache / apache/datafusion-sqlparser-rs

Keywords AT TIME ZONE can be followed by a column

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

描述

We have queries which reference a column after `AT TIME ZONE` rather than just supplying a string. This results in a valid query which executes as expected (in PostgreSQL). The parser currently raises an error `Expected Token::SingleQuotedString after AT TIME ZONE, found: the_column`.

For example, instead of `SELECT datetime_column AT TIME ZONE 'America/Denver' FROM table` it is also valid to have `SELECT datetime_column AT TIME ZONE zone_column FROM table`

I believe further match conditions should be added here to patch: https://github.com/sqlparser-rs/sqlparser-rs/blob/main/src/parser.rs#L1322

贡献指南

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

调研方向

从 src/parser.rs 第 1322 行附近开始,这里 AT TIME ZONE 目前要求使用单引号括起来的字符串。检查在关键字后使用列的示例查询,并验证字面量形式和列形式都能成功解析。

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

评估

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

把新 issue 发到你的邮箱

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