You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "lanklaas (via GitHub)" <gi...@apache.org> on 2024/11/08 05:54:16 UTC

[I] Support for spark `USING` and `OPTIONS` keyword [datafusion-sqlparser-rs]

lanklaas opened a new issue, #1505:
URL: https://github.com/apache/datafusion-sqlparser-rs/issues/1505

   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`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org