You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "r4ntix (via GitHub)" <gi...@apache.org> on 2023/05/05 16:05:10 UTC

[GitHub] [arrow-datafusion] r4ntix commented on a diff in pull request #6247: Minor: document syntax of CREATE EXTERNAL TABLE

r4ntix commented on code in PR #6247:
URL: https://github.com/apache/arrow-datafusion/pull/6247#discussion_r1186265916


##########
docs/source/user-guide/sql/ddl.md:
##########
@@ -47,17 +47,50 @@ CREATE SCHEMA cat.emu;
 
 ## CREATE EXTERNAL TABLE
 
-Parquet data sources can be registered by executing a `CREATE EXTERNAL TABLE` SQL statement. It is not necessary
-to provide schema information for Parquet files.
+`CREATE EXTERNAL TABLE` SQL statement registers a location on a local
+file system or remote object store as a named table which can be queried.
+
+The supported syntax is:
+
+```
+CREATE EXTERNAL TABLE
+[ IF NOT EXISTS ]
+<TABLE_NAME>[ (<column_definition>) ]
+STORED AS <file_type>
+[ WITH HEADER ROW ]
+[ DELIMITER <char> ]
+[ COMPRESSION TYPE <GZIP | BZIP2 | XZ | ZSTD> ]
+[ PARTITIONED BY (<column list>) ]
+[ WITH ORDER (<ordered column list>)
+[ OPTIONS (<key_value_list>)
+LOCATION <literal>
+
+<column_definition> := (<column_name> <data_type>, ...)
+
+<column_list> := (<column_name>, ...)
+
+<ordered_column_list> := (<column_name> <sort_clause>, ...)
+
+<key_value_list> := (<literal> <literal, <literal> <literal>, ...)

Review Comment:
   > I don't think any option is (yet) handled by datafusion core
   > 
   > I believe datafusion-cli handles some: https://arrow.apache.org/datafusion/user-guide/cli.html#registering-s3-data-sources
   > 
   > @r4ntix maybe knows more
   
   @alamb Yes, not all options are supported in datafusion-core. There is no actual `[ OPTIONS (<key_value_list>) ]` support in the current datafusion-core.
   
   @metesynnada Do you mean that for all the `[ ... ]` options, do we need to be more detailed in the documentation?



-- 
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