apache / apache/datafusion-sqlparser-rs

Can't parse jsonb extractions in an on conflict in Postgres

未關閉
#1,977 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Rust
星號
3.5k
分支
772
平均合併
4 天 9 小時
30 天內合併 PR
17

描述

The parser does not support the following:

```sql
INSERT INTO table_with_constraint_over_jsonb (a_number, a_jsonb, a_string)
VALUES ($1, $2, $3)
ON CONFLICT (a_number, (a_jsonb->>'name'))
DO UPDATE SET a_string = EXCLUDED.a_string
RETURNING *;
```

It errors on the `(a_jsonb->>'name')` part with the error: `ParserError("Expected: identifier, found: ( at Line: 1, Column: 119")`.

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

首先,使用 issue 中的 SQL 陳述式重現 parser 錯誤,重點關注 ON CONFLICT target 中帶括號的 jsonb 擷取。追蹤 SQL parser 對 ON CONFLICT 運算式的處理,然後驗證該陳述式能夠成功解析,且不會使其他 conflict target 發生回歸。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
postgres, rust, sql
領域
compilers, databases
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。