-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Create starting point for combined user guide for DataFusion and Ballista #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+191
−27
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 @@ | ||
| book | ||
This file contains hidden or 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 hidden or 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 hidden or 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,33 @@ | ||
| <!--- | ||
| 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. | ||
| --> | ||
| # Summary | ||
|
|
||
| - [Introduction](introduction.md) | ||
| - [Example Usage](example-usage.md) | ||
| - [Use as a Library](library.md) | ||
| - [Distributed](distributed/introduction.md) | ||
| - [Create a Ballista Cluster](distributed/deployment.md) | ||
| - [Docker](distributed/standalone.md) | ||
| - [Docker Compose](distributed/docker-compose.md) | ||
| - [Kubernetes](distributed/kubernetes.md) | ||
| - [Ballista Configuration](distributed/configuration.md) | ||
| - [Clients](distributed/clients.md) | ||
| - [Rust](distributed/client-rust.md) | ||
| - [Python](distributed/client-python.md) | ||
| - [Frequently Asked Questions](faq.md) |
This file contains hidden or 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or 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
File renamed without changes.
This file contains hidden or 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,76 @@ | ||
| <!--- | ||
| 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. | ||
| --> | ||
| # Example Usage | ||
|
|
||
| Run a SQL query against data stored in a CSV: | ||
|
|
||
| ```rust | ||
| use datafusion::prelude::*; | ||
| use arrow::util::pretty::print_batches; | ||
| use arrow::record_batch::RecordBatch; | ||
|
|
||
| #[tokio::main] | ||
| async fn main() -> datafusion::error::Result<()> { | ||
| // register the table | ||
| let mut ctx = ExecutionContext::new(); | ||
| ctx.register_csv("example", "tests/example.csv", CsvReadOptions::new())?; | ||
|
|
||
| // create a plan to run a SQL query | ||
| let df = ctx.sql("SELECT a, MIN(b) FROM example GROUP BY a LIMIT 100")?; | ||
|
|
||
| // execute and print results | ||
| let results: Vec<RecordBatch> = df.collect().await?; | ||
| print_batches(&results)?; | ||
| Ok(()) | ||
| } | ||
| ``` | ||
|
|
||
| Use the DataFrame API to process data stored in a CSV: | ||
|
|
||
| ```rust | ||
| use datafusion::prelude::*; | ||
| use arrow::util::pretty::print_batches; | ||
| use arrow::record_batch::RecordBatch; | ||
|
|
||
| #[tokio::main] | ||
| async fn main() -> datafusion::error::Result<()> { | ||
| // create the dataframe | ||
| let mut ctx = ExecutionContext::new(); | ||
| let df = ctx.read_csv("tests/example.csv", CsvReadOptions::new())?; | ||
|
|
||
| let df = df.filter(col("a").lt_eq(col("b")))? | ||
| .aggregate(vec![col("a")], vec![min(col("b"))])? | ||
| .limit(100)?; | ||
|
|
||
| // execute and print results | ||
| let results: Vec<RecordBatch> = df.collect().await?; | ||
| print_batches(&results)?; | ||
| Ok(()) | ||
| } | ||
| ``` | ||
|
|
||
| Both of these examples will produce | ||
|
|
||
| ```text | ||
| +---+--------+ | ||
| | a | MIN(b) | | ||
| +---+--------+ | ||
| | 1 | 2 | | ||
| +---+--------+ | ||
| ``` |
File renamed without changes.
File renamed without changes
This file contains hidden or 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,44 @@ | ||
| <!--- | ||
| 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 | ||
|
|
||
| DataFusion is an extensible query execution framework, written in | ||
| Rust, that uses [Apache Arrow](https://arrow.apache.org) as its | ||
| in-memory format. | ||
|
|
||
| DataFusion supports both an SQL and a DataFrame API for building | ||
| logical query plans as well as a query optimizer and execution engine | ||
| capable of parallel execution against partitioned data sources (CSV | ||
| and Parquet) using threads. | ||
|
|
||
| ## Use Cases | ||
|
|
||
| DataFusion is used to create modern, fast and efficient data | ||
| pipelines, ETL processes, and database systems, which need the | ||
| performance of Rust and Apache Arrow and want to provide their users | ||
| the convenience of an SQL interface or a DataFrame API. | ||
|
|
||
| ## Why DataFusion? | ||
|
|
||
| * *High Performance*: Leveraging Rust and Arrow's memory model, DataFusion achieves very high performance | ||
| * *Easy to Connect*: Being part of the Apache Arrow ecosystem (Arrow, Parquet and Flight), DataFusion works well with the rest of the big data ecosystem | ||
| * *Easy to Embed*: Allowing extension at almost any point in its design, DataFusion can be tailored for your specific usecase | ||
| * *High Quality*: Extensively tested, both by itself and with the rest of the Arrow ecosystem, DataFusion can be used as the foundation for production systems. | ||
|
|
This file contains hidden or 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,28 @@ | ||
| <!--- | ||
| 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. | ||
| --> | ||
| # Using DataFusion as a library | ||
|
|
||
| DataFusion is [published on crates.io](https://crates.io/crates/datafusion), and is [well documented on docs.rs](https://docs.rs/datafusion/). | ||
|
|
||
| To get started, add the following to your `Cargo.toml` file: | ||
|
|
||
| ```toml | ||
| [dependencies] | ||
| datafusion = "4.0.0-SNAPSHOT" | ||
| ``` |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add a new line at the end of the file?