This is an automated email from the ASF dual-hosted git repository.
alamb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/master by this push:
new 2661fc3 ARROW-11626: [Rust][DataFusion] Move [DataFusion] examples to
own project
2661fc3 is described below
commit 2661fc31648ba621f0d70eaf91ae47dfe552fedd
Author: Heres, Daniel <[email protected]>
AuthorDate: Sun Mar 28 13:27:18 2021 -0400
ARROW-11626: [Rust][DataFusion] Move [DataFusion] examples to own project
Same idea as https://github.com/apache/arrow/pull/9493 but for examples in
DataFusion
FYI @alamb
Clean + building with `cargo test`.
Moving the micro benchmarks out of the crate is also another possibility.
| | Old | New |
| ------------- |:-------------:| -----:|
| Nr dependencies | 309 | 249 |
| build time(s) | 77 |68 |
Closes #9494 from Dandandan/move_datafusion_examples
Lead-authored-by: Heres, Daniel <[email protected]>
Co-authored-by: Daniƫl Heres <[email protected]>
Signed-off-by: Andrew Lamb <[email protected]>
---
.github/workflows/rust.yml | 4 +--
dev/release/00-prepare-test.rb | 18 ++++++++---
rust/Cargo.toml | 1 +
rust/{ => datafusion-examples}/Cargo.toml | 36 +++++++++++++---------
.../examples/README.md | 0
.../examples/csv_sql.rs | 0
.../examples/dataframe.rs | 0
.../examples/dataframe_in_memory.rs | 0
.../examples/flight_client.rs | 0
.../examples/flight_server.rs | 0
.../examples/parquet_sql.rs | 0
.../examples/simple_udaf.rs | 0
.../examples/simple_udf.rs | 0
rust/datafusion/Cargo.toml | 3 --
14 files changed, 38 insertions(+), 24 deletions(-)
diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
index 90831341..1dd220a 100644
--- a/.github/workflows/rust.yml
+++ b/.github/workflows/rust.yml
@@ -116,8 +116,8 @@ jobs:
# run tests on all workspace members with default feature list
cargo test
# test datafusion examples
- cd datafusion
- cargo test --no-default-features --features cli
+ cd datafusion-examples
+ cargo test --no-default-features
cargo run --example csv_sql
cargo run --example parquet_sql
cd ..
diff --git a/dev/release/00-prepare-test.rb b/dev/release/00-prepare-test.rb
index b686ecd..53bd5e8 100644
--- a/dev/release/00-prepare-test.rb
+++ b/dev/release/00-prepare-test.rb
@@ -289,6 +289,13 @@ class PrepareTest < Test::Unit::TestCase
],
},
{
+ path: "rust/datafusion-examples/Cargo.toml",
+ hunks: [
+ ["-version = \"#{@snapshot_version}\"",
+ "+version = \"#{@release_version}\""],
+ ],
+ },
+ {
path: "rust/datafusion/Cargo.toml",
hunks: [
["-version = \"#{@snapshot_version}\"",
@@ -297,8 +304,6 @@ class PrepareTest < Test::Unit::TestCase
"-parquet = { path = \"../parquet\", version =
\"#{@snapshot_version}\", features = [\"arrow\"] }",
"+arrow = { path = \"../arrow\", version =
\"#{@release_version}\", features = [\"prettyprint\"] }",
"+parquet = { path = \"../parquet\", version =
\"#{@release_version}\", features = [\"arrow\"] }"],
- ["-arrow-flight = { path = \"../arrow-flight\", version
= \"#{@snapshot_version}\" }",
- "+arrow-flight = { path = \"../arrow-flight\", version
= \"#{@release_version}\" }"]
],
},
{
@@ -536,6 +541,13 @@ class PrepareTest < Test::Unit::TestCase
],
},
{
+ path: "rust/datafusion-examples/Cargo.toml",
+ hunks: [
+ ["-version = \"#{@release_version}\"",
+ "+version = \"#{@next_snapshot_version}\""],
+ ],
+ },
+ {
path: "rust/datafusion/Cargo.toml",
hunks: [
["-version = \"#{@release_version}\"",
@@ -544,8 +556,6 @@ class PrepareTest < Test::Unit::TestCase
"-parquet = { path = \"../parquet\", version =
\"#{@release_version}\", features = [\"arrow\"] }",
"+arrow = { path = \"../arrow\", version =
\"#{@next_snapshot_version}\", features = [\"prettyprint\"] }",
"+parquet = { path = \"../parquet\", version =
\"#{@next_snapshot_version}\", features = [\"arrow\"] }"],
- ["-arrow-flight = { path = \"../arrow-flight\", version
= \"#{@release_version}\" }",
- "+arrow-flight = { path = \"../arrow-flight\", version
= \"#{@next_snapshot_version}\" }"]
],
},
{
diff --git a/rust/Cargo.toml b/rust/Cargo.toml
index 16e34de..c299004 100644
--- a/rust/Cargo.toml
+++ b/rust/Cargo.toml
@@ -22,6 +22,7 @@ members = [
"parquet_derive",
"parquet_derive_test",
"datafusion",
+ "datafusion-examples",
"arrow-flight",
"integration-testing",
"benchmarks",
diff --git a/rust/Cargo.toml b/rust/datafusion-examples/Cargo.toml
similarity index 55%
copy from rust/Cargo.toml
copy to rust/datafusion-examples/Cargo.toml
index 16e34de..c86e7cc 100644
--- a/rust/Cargo.toml
+++ b/rust/datafusion-examples/Cargo.toml
@@ -15,19 +15,25 @@
# specific language governing permissions and limitations
# under the License.
-[workspace]
-members = [
- "arrow",
- "parquet",
- "parquet_derive",
- "parquet_derive_test",
- "datafusion",
- "arrow-flight",
- "integration-testing",
- "benchmarks",
-]
+[package]
+name = "datafusion-examples"
+description = "DataFusion usage examples"
+version = "4.0.0-SNAPSHOT"
+homepage = "https://github.com/apache/arrow"
+repository = "https://github.com/apache/arrow"
+authors = ["Apache Arrow <[email protected]>"]
+license = "Apache-2.0"
+keywords = [ "arrow", "query", "sql" ]
+edition = "2018"
+publish = false
-# this package is excluded because it requires different compilation flags,
thereby significantly changing
-# how it is compiled within the workspace, causing the whole workspace to be
compiled from scratch
-# this way, this is a stand-alone package that compiles independently of the
others.
-exclude = ["arrow-pyarrow-integration-testing"]
+
+[dev-dependencies]
+datafusion = { path = "../datafusion" }
+arrow = { path = "../arrow" }
+prost = "0.7"
+arrow-flight = { path = "../arrow-flight" }
+tonic = "0.4"
+tokio = { version = "1.0", features = ["macros", "rt", "rt-multi-thread",
"sync"] }
+futures = "0.3"
+num_cpus = "1.13.0"
diff --git a/rust/datafusion/examples/README.md
b/rust/datafusion-examples/examples/README.md
similarity index 100%
rename from rust/datafusion/examples/README.md
rename to rust/datafusion-examples/examples/README.md
diff --git a/rust/datafusion/examples/csv_sql.rs
b/rust/datafusion-examples/examples/csv_sql.rs
similarity index 100%
rename from rust/datafusion/examples/csv_sql.rs
rename to rust/datafusion-examples/examples/csv_sql.rs
diff --git a/rust/datafusion/examples/dataframe.rs
b/rust/datafusion-examples/examples/dataframe.rs
similarity index 100%
rename from rust/datafusion/examples/dataframe.rs
rename to rust/datafusion-examples/examples/dataframe.rs
diff --git a/rust/datafusion/examples/dataframe_in_memory.rs
b/rust/datafusion-examples/examples/dataframe_in_memory.rs
similarity index 100%
rename from rust/datafusion/examples/dataframe_in_memory.rs
rename to rust/datafusion-examples/examples/dataframe_in_memory.rs
diff --git a/rust/datafusion/examples/flight_client.rs
b/rust/datafusion-examples/examples/flight_client.rs
similarity index 100%
rename from rust/datafusion/examples/flight_client.rs
rename to rust/datafusion-examples/examples/flight_client.rs
diff --git a/rust/datafusion/examples/flight_server.rs
b/rust/datafusion-examples/examples/flight_server.rs
similarity index 100%
rename from rust/datafusion/examples/flight_server.rs
rename to rust/datafusion-examples/examples/flight_server.rs
diff --git a/rust/datafusion/examples/parquet_sql.rs
b/rust/datafusion-examples/examples/parquet_sql.rs
similarity index 100%
rename from rust/datafusion/examples/parquet_sql.rs
rename to rust/datafusion-examples/examples/parquet_sql.rs
diff --git a/rust/datafusion/examples/simple_udaf.rs
b/rust/datafusion-examples/examples/simple_udaf.rs
similarity index 100%
rename from rust/datafusion/examples/simple_udaf.rs
rename to rust/datafusion-examples/examples/simple_udaf.rs
diff --git a/rust/datafusion/examples/simple_udf.rs
b/rust/datafusion-examples/examples/simple_udf.rs
similarity index 100%
rename from rust/datafusion/examples/simple_udf.rs
rename to rust/datafusion-examples/examples/simple_udf.rs
diff --git a/rust/datafusion/Cargo.toml b/rust/datafusion/Cargo.toml
index 94e56a4..3236a97 100644
--- a/rust/datafusion/Cargo.toml
+++ b/rust/datafusion/Cargo.toml
@@ -75,9 +75,6 @@ lazy_static = { version = "^1.4.0", optional = true }
rand = "0.8"
criterion = "0.3"
tempfile = "3"
-prost = "0.7"
-arrow-flight = { path = "../arrow-flight", version = "4.0.0-SNAPSHOT" }
-tonic = "0.4"
doc-comment = "0.3"
[[bench]]