ballista-cli

Crates.ioballista-cli
lib.rsballista-cli
version0.12.0
sourcesrc
created_at2022-05-16 13:03:26.252328
updated_at2024-02-07 00:28:00.924799
descriptionCommand Line Client for Ballista distributed query engine.
homepagehttps://github.com/apache/arrow-ballista
repositoryhttps://github.com/apache/arrow-ballista
max_upload_size
id587644
size148,210
Andy Grove (andygrove)

documentation

README

Ballista Command-line Interface

Ballista is a distributed query execution framework, written in Rust, that uses Apache Arrow as its in-memory format.

The Ballista CLI allows SQL queries to be executed by an in-process DataFusion context, or by a distributed Ballista context.

USAGE:
    ballista-cli [FLAGS] [OPTIONS]

FLAGS:
    -h, --help       Prints help information
    -q, --quiet      Reduce printing other than the results and work quietly
    -V, --version    Prints version information

OPTIONS:
    -c, --batch-size <batch-size>    The batch size of each query, or use DataFusion default
    -p, --data-path <data-path>      Path to your data, default to current directory
    -f, --file <file>...             Execute commands from file(s), then exit
        --format <format>            Output format [default: table]  [possible values: csv, tsv, table, json, ndjson]
        --host <host>                Ballista scheduler host
        --port <port>                Ballista scheduler port

Example

Create a CSV file to query.

$ echo "1,2" > data.csv
$ ballista-cli

Ballista CLI v0.6.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.

Ballista-Cli

If you want to execute the SQL in ballista by ballista-cli, you must build/compile ballista-cli first.

cd arrow-ballista/ballista-cli
cargo build

The Ballista CLI can connect to a Ballista scheduler for query execution.

ballista-cli --host localhost --port 50050
Commit count: 4249

cargo fmt