Skip to content

Commit

Permalink
Minor: add more example for Create Table doc
Browse files Browse the repository at this point in the history
  • Loading branch information
comphead committed Sep 18, 2023
1 parent 81f33b0 commit 81592db
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions docs/source/user-guide/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ The DataFusion CLI is a command-line interactive SQL utility for executing
queries against any supported data files. It is a convenient way to
try DataFusion's SQL support with your own data.

## Selecting 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.
Expand Down Expand Up @@ -131,24 +136,33 @@ OPTIONS:
-V, --version Print version information
```
## Selecting files directly
Files can be queried directly by enclosing the file or
directory name in single `'` quotes as shown in the example.
## Creating external tables
It is also possible to create a table backed by files by explicitly
via `CREATE EXTERNAL TABLE` as shown below.
via `CREATE EXTERNAL TABLE` as shown below. Filemask wildcards supported
## Registering Parquet Data Sources
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.
Parquet data sources can be registered by executing a `CREATE EXTERNAL TABLE` SQL statement. The schema information will be derived automatically.
```sql
CREATE EXTERNAL TABLE taxi
STORED AS PARQUET
LOCATION '/mnt/nyctaxi/tripdata.parquet';
```
```sql
CREATE EXTERNAL TABLE taxi
STORED AS PARQUET
LOCATION '/mnt/nyctaxi/';
```
```sql
CREATE EXTERNAL TABLE taxi
STORED AS PARQUET
LOCATION '/mnt/nyctaxi/*.parquet';
```
## Registering CSV Data Sources
CSV data sources can be registered by executing a `CREATE EXTERNAL TABLE` SQL statement.
Expand Down

0 comments on commit 81592db

Please sign in to comment.