Crate datafusion_cli
source · [−]Expand description
DataFusion Command-line Interface
DataFusion is an extensible query execution framework, written in Rust, that uses Apache Arrow as its in-memory format.
The DataFusion CLI allows SQL queries to be executed by an in-process DataFusion context.
ⓘ
USAGE:
datafusion-cli [OPTIONS]
OPTIONS:
-c, --batch-size <BATCH_SIZE> The batch size of each query, or use DataFusion default
-f, --file <FILE>... Execute commands from file(s), then exit
--format <FORMAT> [default: table] [possible values: csv, tsv, table, json,
nd-json]
-h, --help Print help information
-p, --data-path <DATA_PATH> Path to your data, default to current directory
-q, --quiet Reduce printing other than the results and work quietly
-r, --rc <RC>... Run the provided files on startup instead of ~/.datafusionrc
-V, --version Print version information
Example
Create a CSV file to query.
$ echo "1,2" > data.csv
$ datafusion-cli
DataFusion CLI v8.0.0
> CREATE EXTERNAL TABLE foo (a INT, b INT) STORED AS CSV LOCATION 'data.csv';
0 rows in set. Query took 0.001 seconds.
> SELECT * FROM foo;
+---+---+
| a | b |
+---+---+
| 1 | 2 |
+---+---+
1 row in set. Query took 0.017 seconds.
DataFusion-Cli
Build the datafusion-cli
.
cd arrow-datafusion/datafusion-cli
cargo build
Modules
Command within CLI
Execution functions
Functions that are query-able and searchable via the \h
command
Helper that helps with interactive editing, including multi-line parsing and validation, and auto-completion for file name during creating external table.
Print format variants