apache / apache/datafusion-sqlparser-rs

Can't parse valid Snowflake compound expression

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

描述

Hey there, thanks for the great project!

I'm encountering an issue with the following query, which is valid in Snowflake:

```sql
SELECT v.$2 FROM (VALUES (1, 'value1'), (2, 'value2')) AS v
```

It can't get parsed with sqlparser-rs:

```
Expected: an identifier or a '*' after '.', found: $2 at Line: 1, Column: 10
```

While this syntax isn't valid in PostgreSQL, it is accepted by Snowflake. `SELECT $2 FROM ...` (without the alias) parses correctly, so it seems the parser has trouble with positional parameters when they're part of compound expressions.

Is this a gap in the Snowflake dialect implementation?

貢獻指南

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

研究方向

首先,在 parser 的 Snowflake 方言處理中重現 Snowflake 查詢 `SELECT v.$2 FROM (VALUES (1, 'value1'), (2, 'value2')) AS v`。追蹤複合運算式如何處理 alias 後的 `$2` 位置參數。完成標準是:這個有效的 Snowflake 運算式能夠成功解析,同時不會讓現有的 `SELECT $2 FROM ...` 情況發生回歸。

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

評估

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

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

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