apache / apache/datafusion-sqlparser-rs

Support for spark `USING` and `OPTIONS` keyword

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

描述

Hi,

I was trying to extract options from a create table query, but it seems like this syntax from spark is not supported:

```sql
CREATE TABLE chin_dbo_Track_LIMIT USING org.apache.spark.sql.jdbc OPTIONS (url "jdbc:sqlserver://localhost:1433;database=Chinook;user=sa;password=mypassword",dbtable "(SELECT TOP 100
[E12].[TrackId] [TrackId]
,[E12].[Name] [Name]
,[E12].[AlbumId] [AlbumId]
,[E12].[MediaTypeId] [MediaTypeId]
,[E12].[GenreId] [GenreId]
,[E12].[Composer] [Composer]
,[E12].[Milliseconds] [Milliseconds]
,[E12].[Bytes] [Bytes]
,[E12].[UnitPrice] [UnitPrice]
FROM
[Chinook].[dbo].[Track] [E12]) obj",driver "com.microsoft.sqlserver.jdbc.SQLServerDriver")
```

Parse error:

```
ParserError("Expected: end of statement, found: USING at Line: 2, Column: 43")
```

This also does not work if I remove the using JDBC part, then it does not expect `OPTIONS`

贡献指南

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

调研方向

使用提供的 Spark CREATE TABLE 语句重现报告的 parser 错误,然后跟踪 CREATE TABLE 解析入口点以及现有的表选项测试。支持的 USING 和 OPTIONS 语法能够成功解析,并且回归覆盖率能够验证该示例而不破坏现有的 CREATE TABLE 语句时,工作即完成。

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

评估

技术栈
rust, sql
领域
databases
Issue 类型
功能
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

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