-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Ballista support to DataFusion CLI (#889)
- Loading branch information
Showing
6 changed files
with
240 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ name = "datafusion-cli" | |
version = "4.0.0-SNAPSHOT" | ||
authors = ["Apache Arrow <[email protected]>"] | ||
edition = "2018" | ||
keywords = [ "arrow", "query", "sql", "cli", "repl" ] | ||
keywords = [ "arrow", "datafusion", "ballista", "query", "sql", "cli", "repl" ] | ||
license = "Apache-2.0" | ||
homepage = "https://github.com/apache/arrow-datafusion" | ||
repository = "https://github.com/apache/arrow-datafusion" | ||
|
@@ -31,4 +31,5 @@ clap = "2.33" | |
rustyline = "8.0" | ||
tokio = { version = "1.0", features = ["macros", "rt", "rt-multi-thread", "sync"] } | ||
datafusion = { path = "../datafusion", version = "5.1.0" } | ||
arrow = { version = "5.0" } | ||
ballista = { path = "../ballista/rust/client", version = "0.6.0" } | ||
arrow = { version = "5.0" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<!--- | ||
Licensed to the Apache Software Foundation (ASF) under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The ASF licenses this file | ||
to you under the Apache License, Version 2.0 (the | ||
"License"); you may not use this file except in compliance | ||
with the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, | ||
software distributed under the License is distributed on an | ||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, either express or implied. See the License for the | ||
specific language governing permissions and limitations | ||
under the License. | ||
--> | ||
|
||
# DataFusion Command-line Interface | ||
|
||
The DataFusion CLI allows SQL queries to be executed by an in-process DataFusion context, or by a distributed | ||
Ballista context. | ||
|
||
```ignore | ||
USAGE: | ||
datafusion-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. | ||
|
||
```bash,ignore | ||
$ echo "1,2" > data.csv | ||
``` | ||
|
||
```sql,ignore | ||
$ datafusion-cli | ||
DataFusion CLI v4.0.0-SNAPSHOT | ||
> 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 | ||
|
||
The DataFusion CLI can connect to a Ballista scheduler for query execution. | ||
|
||
```bash,ignore | ||
datafusion-cli --host localhost --port 50050 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.