You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2023/05/05 10:58:45 UTC
[GitHub] [arrow-datafusion] alamb opened a new issue, #6248: Make `CREATE EXTERNAL TABLE` more user friendly
alamb opened a new issue, #6248:
URL: https://github.com/apache/arrow-datafusion/issues/6248
### Is your feature request related to a problem or challenge?
At the moment, the `CREATE EXTERNAL TABLE` command requires all clauses in an exact order: https://arrow.apache.org/datafusion/user-guide/sql/ddl.html#create-external-table
So this is great:
```sql
CREATE EXTERNAL TABLE test
STORED AS CSV
WITH HEADER ROW
LOCATION '/path/to/directory/of/files';
```
However, generates a somewhat confusing syntax error:
```sql
CREATE EXTERNAL TABLE test
WITH HEADER ROW
STORED AS CSV
LOCATION '/path/to/directory/of/files';
```
```
🤔 Invalid statement: sql parser error: Expected STORED, found: WITH
```
I think https://github.com/apache/arrow-datafusion/pull/6247 will help but we can do better
### Describe the solution you'd like
I would like to extend the CREATE EXTERNAL TABLE syntax parser so the various clauses can be provided in any order and people don't have to put them in a specific order
Aka I want this (and similar) to work:
```sql
CREATE EXTERNAL TABLE test
WITH HEADER ROW
STORED AS CSV
LOCATION '/path/to/directory/of/files';
```
parser code is here: https://github.com/apache/arrow-datafusion/blob/main/datafusion/sql/src/parser.rs
There is an example of doing similar things in sqlparser-rs for `CREATE FUNCTION`: https://github.com/sqlparser-rs/sqlparser-rs/blob/b29b551fa111bbd50c40568f6aea6c49eafc0b9c/src/parser.rs#L2673-L2702
### Describe alternatives you've considered
_No response_
### Additional context
I am trying to help here: https://github.com/apache/arrow-datafusion/pull/6247
I struggled with this syntax while trying to port some sqllogictests: https://github.com/apache/arrow-datafusion/pull/6234
--
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@arrow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] aprimadi commented on issue #6248: Make `CREATE EXTERNAL TABLE` more user friendly
Posted by "aprimadi (via GitHub)" <gi...@apache.org>.
aprimadi commented on issue #6248:
URL: https://github.com/apache/arrow-datafusion/issues/6248#issuecomment-1537037241
Currently working on this
--
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@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] alamb closed issue #6248: Make `CREATE EXTERNAL TABLE` more user friendly
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb closed issue #6248: Make `CREATE EXTERNAL TABLE` more user friendly
URL: https://github.com/apache/arrow-datafusion/issues/6248
--
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@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org