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 摘要。