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/09/19 00:51:34 UTC
[GitHub] [arrow-datafusion] alamb commented on a diff in pull request #7594: Minor: add more examples for `CREATE EXTERNAL TABLE` doc
alamb commented on code in PR #7594:
URL: https://github.com/apache/arrow-datafusion/pull/7594#discussion_r1329426601
##########
docs/source/user-guide/cli.md:
##########
@@ -131,24 +88,87 @@ OPTIONS:
-V, --version Print version information
```
-## Selecting files directly
+## Querying data from the files directly
Files can be queried directly by enclosing the file or
directory name in single `'` quotes as shown in the example.
+## Example
+
+Create a CSV file to query.
+
+```shell
+$ echo "a,b" > data.csv
+$ echo "1,2" >> data.csv
+```
+
+Query that single file (the CLI also supports parquet, compressed csv, avro, json and more)
+
+```shell
+$ datafusion-cli
+DataFusion CLI v17.0.0
+❯ select * from 'data.csv';
++---+---+
+| a | b |
++---+---+
+| 1 | 2 |
++---+---+
+1 row in set. Query took 0.007 seconds.
+```
+
+You can also query directories of files with compatible schemas:
Review Comment:
👍
##########
docs/source/user-guide/cli.md:
##########
@@ -131,24 +88,87 @@ OPTIONS:
-V, --version Print version information
```
-## Selecting files directly
+## Querying data from the files directly
Files can be queried directly by enclosing the file or
directory name in single `'` quotes as shown in the example.
+## Example
+
+Create a CSV file to query.
+
+```shell
+$ echo "a,b" > data.csv
+$ echo "1,2" >> data.csv
+```
+
+Query that single file (the CLI also supports parquet, compressed csv, avro, json and more)
+
+```shell
+$ datafusion-cli
+DataFusion CLI v17.0.0
+❯ select * from 'data.csv';
++---+---+
+| a | b |
++---+---+
+| 1 | 2 |
++---+---+
+1 row in set. Query took 0.007 seconds.
+```
+
+You can also query directories of files with compatible schemas:
+
+```shell
+$ ls data_dir/
+data.csv data2.csv
+```
+
+```shell
+$ datafusion-cli
+DataFusion CLI v16.0.0
Review Comment:
It doesn't really matter, but it might be nice to have the versions be consistent
```suggestion
DataFusion CLI v17.0.0
```
##########
docs/source/user-guide/cli.md:
##########
@@ -131,24 +88,87 @@ OPTIONS:
-V, --version Print version information
```
-## Selecting files directly
+## Querying data from the files directly
Files can be queried directly by enclosing the file or
directory name in single `'` quotes as shown in the example.
+## Example
+
+Create a CSV file to query.
+
+```shell
+$ echo "a,b" > data.csv
+$ echo "1,2" >> data.csv
+```
+
+Query that single file (the CLI also supports parquet, compressed csv, avro, json and more)
+
+```shell
+$ datafusion-cli
+DataFusion CLI v17.0.0
+❯ select * from 'data.csv';
++---+---+
+| a | b |
++---+---+
+| 1 | 2 |
++---+---+
+1 row in set. Query took 0.007 seconds.
+```
+
+You can also query directories of files with compatible schemas:
Review Comment:
👍
--
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