apache / apache/datafusion-sqlparser-rs

IDENTIFIER literal with double quotes inside single quotes is parsed as one token instead of multiple identifiers

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

描述

When running the following statement:

CREATE TABLE IDENTIFIER('"ORGDATA"."PUBLIC"."car_sales"')

the parser produces:

SingleQuotedString("\"ORGDATA\".\"PUBLIC\".\"car_sales\"")

It is treated as a single token (a literal string) instead of being parsed into three separate identifiers ("ORGDATA", "PUBLIC", "car_sales").
Since the IDENTIFIER function expects a literal, the content must be re-parsed.

**Suggestions:**

1. Expose a function that can take a SingleQuotedString like: '"ORGDATA"."PUBLIC"."car_sales"' and re-parse it into separate Ident tokens (ORGDATA, PUBLIC, car_sales).

2. change the tokenizer so that when IDENTIFIER is used with a quoted string containing double quotes, the inner content is tokenized as identifiers rather than treated as a raw single string.

贡献指南

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

调研方向

首先追踪 parser 如何处理 CREATE TABLE IDENTIFIER(...) ,以及 SingleQuotedString 值如何到达 IDENTIFIER 函数或 tokenizer。复现该示例,并确定预期结果是否为三个带引号的标识符;完成的标准是输入不再被当作一个字面量处理,同时现有的解析行为保持不变。

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

评估

技术栈
rust
领域
compilers
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

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