Apache DataFusion SQL Query Engine
Combine Cargo workspaces (#23)
Andy Grove74cdf6f66719
diff --git a/Cargo.toml b/Cargo.tomlindex 0a4ef2a7f2..0947beadac 100644--- a/Cargo.toml+++ b/Cargo.toml@@ -17,12 +17,12 @@[workspace]members = [- "datafusion",- "datafusion-examples",+ "datafusion",+ "datafusion-examples","benchmarks",-]--# 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 = ["ballista"]+ "ballista/rust/benchmarks/tpch",+ "ballista/rust/client",+ "ballista/rust/core",+ "ballista/rust/executor",+ "ballista/rust/scheduler",+]\ No newline at end of filediff --git a/ballista/rust/Cargo.toml b/ballista/rust/Cargo.tomldeleted file mode 100644index 5e344e004b..0000000000--- a/ballista/rust/Cargo.toml+++ /dev/null@@ -1,30 +0,0 @@-# 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.--[workspace]--members = [- "benchmarks/tpch",- "client",- "core",- "executor",- "scheduler",-]--#[profile.release]-#lto = true-#codegen-units = 1diff --git a/ballista/rust/benchmarks/tpch/Cargo.toml b/ballista/rust/benchmarks/tpch/Cargo.tomlindex 601943d867..9311f23ad8 100644--- a/ballista/rust/benchmarks/tpch/Cargo.toml+++ b/ballista/rust/benchmarks/tpch/Cargo.toml@@ -17,7 +17,7 @@[package]name = "tpch"-version = "0.4.2-SNAPSHOT"+version = "0.5.0-SNAPSHOT"homepage = "https://github.com/apache/arrow"repository = "https://github.com/apache/arrow"authors = ["Apache Arrow <[email protected]>"]diff --git a/ballista/rust/client/Cargo.toml b/ballista/rust/client/Cargo.tomlindex fdce1c47a9..d29f23ada8 100644--- a/ballista/rust/client/Cargo.toml+++ b/ballista/rust/client/Cargo.toml@@ -19,7 +19,7 @@name = "ballista"description = "Ballista Distributed Compute"license = "Apache-2.0"-version = "0.4.2-SNAPSHOT"+version = "0.5.0-SNAPSHOT"homepage = "https://github.com/apache/arrow"repository = "https://github.com/apache/arrow"authors = ["Apache Arrow <[email protected]>"]diff --git a/ballista/rust/client/src/context.rs b/ballista/rust/client/src/context.rsindex 400f6b6183..a4cca7a099 100644--- a/ballista/rust/client/src/context.rs+++ b/ballista/rust/client/src/context.rs@@ -30,7 +30,7 @@ use ballista_core::serde::protobuf::{};use ballista_core::{client::BallistaClient,- datasource::DFTableAdapter,+ datasource::DfTableAdapter,error::{BallistaError, Result},memory_stream::MemoryStream,utils::create_datafusion_context,@@ -151,7 +151,7 @@ impl BallistaContext {let execution_plan = ctx.create_physical_plan(&plan)?;ctx.register_table(TableReference::Bare { table: name },- Arc::new(DFTableAdapter::new(plan, execution_plan)),+ Arc::new(DfTableAdapter::new(plan, execution_plan)),)?;}let df = ctx.sql(sql)?;diff --git a/ballista/rust/core/Cargo.toml b/ballista/rust/core/Cargo.tomlindex 5a77691359..0a600ea21c 100644--- a/ballista/rust/core/Cargo.toml+++ b/ballista/rust/core/Cargo.toml@@ -19,7 +19,7 @@name = "ballista-core"description = "Ballista Distributed Compute"license = "Apache-2.0"-version = "0.4.2-SNAPSHOT"+version = "0.5.0-SNAPSHOT"homepage = "https://github.com/apache/arrow"repository = "https://github.com/apache/arrow"authors = ["Apache Arrow <[email protected]>"]diff --git a/ballista/rust/core/src/datasource.rs b/ballista/rust/core/src/datasource.rsindex 8ff0df44e4..5b1540ac50 100644--- a/ballista/rust/core/src/datasource.rs+++ b/ballista/rust/core/src/datasource.rs@@ -30,20 +30,20 @@ use datafusion::{/// TableProvider which is effectively a wrapper around a physical plan. We need to be able to/// register tables so that we can create logical plans from SQL statements that reference these/// tables.-pub struct DFTableAdapter {+pub struct DfTableAdapter {/// DataFusion logical planpub logical_plan: LogicalPlan,/// DataFusion execution planplan: Arc<dyn ExecutionPlan>,}-impl DFTableAdapter {+impl DfTableAdapter {pub fn new(logical_plan: LogicalPlan, plan: Arc<dyn ExecutionPlan>) -> Self {Self { logical_plan, plan }}}-impl TableProvider for DFTableAdapter {+impl TableProvider for DfTableAdapter {fn as_any(&self) -> &dyn Any {self}diff --git a/ballista/rust/core/src/error.rs b/ballista/rust/core/src/error.rsindex d0155ce4b7..e16920e047 100644--- a/ballista/rust/core/src/error.rs+++ b/ballista/rust/core/src/error.rs@@ -49,6 +49,7 @@ pub enum BallistaError {TokioError(tokio::task::JoinError),}+#[allow(clippy::from_over_into)]impl<T> Into<Result<T>> for BallistaError {fn into(self) -> Result<T> {Err(self)diff --git a/ballista/rust/core/src/serde/logical_plan/from_proto.rs b/ballista/rust/core/src/serde/logical_plan/from_proto.rsindex 9308426066..18a85d2796 100644--- a/ballista/rust/core/src/serde/logical_plan/from_proto.rs+++ b/ballista/rust/core/src/serde/logical_plan/from_proto.rs@@ -436,6 +436,7 @@ impl TryInto<arrow::datatypes::DataType> for &protobuf::arrow_type::ArrowTypeEnu}}+#[allow(clippy::from_over_into)]impl Into<arrow::datatypes::DataType> for protobuf::PrimitiveScalarType {fn into(self) -> arrow::datatypes::DataType {use arrow::datatypes::DataType;@@ -1170,6 +1171,7 @@ impl TryFrom<i32> for protobuf::FileType {}}+#[allow(clippy::from_over_into)]impl Into<datafusion::sql::parser::FileType> for protobuf::FileType {fn into(self) -> datafusion::sql::parser::FileType {use datafusion::sql::parser::FileType;diff --git a/ballista/rust/core/src/serde/logical_plan/to_proto.rs b/ballista/rust/core/src/serde/logical_plan/to_proto.rsindex 222b76739f..560578df9f 100644--- a/ballista/rust/core/src/serde/logical_plan/to_proto.rs+++ b/ballista/rust/core/src/serde/logical_plan/to_proto.rs@@ -24,7 +24,7 @@ use std::{convert::{TryFrom, TryInto},};-use crate::datasource::DFTableAdapter;+use crate::datasource::DfTableAdapter;use crate::serde::{protobuf, BallistaError};use arrow::datatypes::{DataType, Schema};@@ -679,7 +679,7 @@ impl TryInto<protobuf::LogicalPlanNode> for &LogicalPlan {// unwrap the DFTableAdapter to get to the real TableProviderlet source = if let Some(adapter) =- source.as_any().downcast_ref::<DFTableAdapter>()+ source.as_any().downcast_ref::<DfTableAdapter>(){match &adapter.logical_plan {LogicalPlan::TableScan { source, .. } => Ok(source.as_any()),@@ -1021,7 +1021,7 @@ impl TryInto<protobuf::LogicalExprNode> for &Expr {let fun: protobuf::ScalarFunction = fun.try_into()?;let expr: Vec<protobuf::LogicalExprNode> = args.iter()- .map(|e| Ok(e.try_into()?))+ .map(|e| e.try_into()).collect::<Result<Vec<protobuf::LogicalExprNode>, BallistaError>>()?;Ok(protobuf::LogicalExprNode {expr_type: Some(@@ -1164,6 +1164,7 @@ impl TryInto<protobuf::LogicalExprNode> for &Expr {}}+#[allow(clippy::from_over_into)]impl Into<protobuf::Schema> for &Schema {fn into(self) -> protobuf::Schema {protobuf::Schema {diff --git a/ballista/rust/core/src/serde/scheduler/from_proto.rs b/ballista/rust/core/src/serde/scheduler/from_proto.rsindex fb1e4f812d..4631b2e4d8 100644--- a/ballista/rust/core/src/serde/scheduler/from_proto.rs+++ b/ballista/rust/core/src/serde/scheduler/from_proto.rs@@ -72,6 +72,7 @@ impl TryInto<PartitionId> for protobuf::PartitionId {}}+#[allow(clippy::from_over_into)]impl Into<PartitionStats> for protobuf::PartitionStats {fn into(self) -> PartitionStats {PartitionStats::new(diff --git a/ballista/rust/core/src/serde/scheduler/mod.rs b/ballista/rust/core/src/serde/scheduler/mod.rsindex 81d8722d7f..bbbd48b74a 100644--- a/ballista/rust/core/src/serde/scheduler/mod.rs+++ b/ballista/rust/core/src/serde/scheduler/mod.rs@@ -75,6 +75,7 @@ pub struct ExecutorMeta {pub port: u16,}+#[allow(clippy::from_over_into)]impl Into<protobuf::ExecutorMetadata> for ExecutorMeta {fn into(self) -> protobuf::ExecutorMetadata {protobuf::ExecutorMetadata {diff --git a/ballista/rust/core/src/serde/scheduler/to_proto.rs b/ballista/rust/core/src/serde/scheduler/to_proto.rsindex f581becdea..40ca907a8a 100644--- a/ballista/rust/core/src/serde/scheduler/to_proto.rs+++ b/ballista/rust/core/src/serde/scheduler/to_proto.rs@@ -55,6 +55,7 @@ impl TryInto<protobuf::ExecutePartition> for ExecutePartition {}}+#[allow(clippy::from_over_into)]impl Into<protobuf::PartitionId> for PartitionId {fn into(self) -> protobuf::PartitionId {protobuf::PartitionId {@@ -77,6 +78,7 @@ impl TryInto<protobuf::PartitionLocation> for PartitionLocation {}}+#[allow(clippy::from_over_into)]impl Into<protobuf::PartitionStats> for PartitionStats {fn into(self) -> protobuf::PartitionStats {let none_value = -1_i64;diff --git a/ballista/rust/executor/Cargo.toml b/ballista/rust/executor/Cargo.tomlindex 3df5f6ba16..15bef69fa9 100644--- a/ballista/rust/executor/Cargo.toml+++ b/ballista/rust/executor/Cargo.toml@@ -19,14 +19,13 @@name = "ballista-executor"description = "Ballista Distributed Compute - Executor"license = "Apache-2.0"-version = "0.4.2-SNAPSHOT"+version = "0.5.0-SNAPSHOT"homepage = "https://github.com/apache/arrow"repository = "https://github.com/apache/arrow"authors = ["Apache Arrow <[email protected]>"]edition = "2018"[features]-default = ["snmalloc"]snmalloc = ["snmalloc-rs"][dependencies]diff --git a/ballista/rust/scheduler/Cargo.toml b/ballista/rust/scheduler/Cargo.tomlindex 6c7fc58aae..342f215849 100644--- a/ballista/rust/scheduler/Cargo.toml+++ b/ballista/rust/scheduler/Cargo.toml@@ -19,7 +19,7 @@name = "ballista-scheduler"description = "Ballista Distributed Compute - Scheduler"license = "Apache-2.0"-version = "0.4.2-SNAPSHOT"+version = "0.5.0-SNAPSHOT"homepage = "https://github.com/apache/arrow"repository = "https://github.com/apache/arrow"authors = ["Apache Arrow <[email protected]>"]diff --git a/ballista/rust/scheduler/src/planner.rs b/ballista/rust/scheduler/src/planner.rsindex e9f668a7d5..e791fa8b54 100644--- a/ballista/rust/scheduler/src/planner.rs+++ b/ballista/rust/scheduler/src/planner.rs@@ -25,7 +25,7 @@ use std::time::Instant;use std::{collections::HashMap, future::Future};use ballista_core::client::BallistaClient;-use ballista_core::datasource::DFTableAdapter;+use ballista_core::datasource::DfTableAdapter;use ballista_core::error::{BallistaError, Result};use ballista_core::serde::scheduler::ExecutorMeta;use ballista_core::serde::scheduler::PartitionId;@@ -138,7 +138,7 @@ impl DistributedPlanner {stages.append(&mut child_stages);}- if let Some(adapter) = execution_plan.as_any().downcast_ref::<DFTableAdapter>() {+ if let Some(adapter) = execution_plan.as_any().downcast_ref::<DfTableAdapter>() {// remove Repartition rule because that isn't supported yetlet rules: Vec<Arc<dyn PhysicalOptimizerRule + Send + Sync>> = vec![Arc::new(CoalesceBatches::new()),diff --git a/dev/docker/rust.dockerfile b/dev/docker/rust.dockerfileindex 19dd4879ea..6505f3c166 100644--- a/dev/docker/rust.dockerfile+++ b/dev/docker/rust.dockerfile@@ -59,20 +59,18 @@ ARG RELEASE_FLAG=--release# force build.rs to run to generate configure_me code.ENV FORCE_REBUILD='true'RUN cargo build $RELEASE_FLAG-RUN cd ballista/rust && \- cargo build $RELEASE_FLAG# put the executor on /executor (need to be copied from different places depending on FLAG)ENV RELEASE_FLAG=${RELEASE_FLAG}-RUN if [ -z "$RELEASE_FLAG" ]; then mv /tmp/ballista/ballista/rust/target/debug/ballista-executor /executor; else mv /tmp/ballista/ballista/rust/target/release/ballista-executor /executor; fi+RUN if [ -z "$RELEASE_FLAG" ]; then mv /tmp/ballista/target/debug/ballista-executor /executor; else mv /tmp/ballista/target/release/ballista-executor /executor; fi# put the scheduler on /scheduler (need to be copied from different places depending on FLAG)ENV RELEASE_FLAG=${RELEASE_FLAG}-RUN if [ -z "$RELEASE_FLAG" ]; then mv /tmp/ballista/ballista/rust/target/debug/ballista-scheduler /scheduler; else mv /tmp/ballista/ballista/rust/target/release/ballista-scheduler /scheduler; fi+RUN if [ -z "$RELEASE_FLAG" ]; then mv /tmp/ballista/target/debug/ballista-scheduler /scheduler; else mv /tmp/ballista/target/release/ballista-scheduler /scheduler; fi# put the tpch on /tpch (need to be copied from different places depending on FLAG)ENV RELEASE_FLAG=${RELEASE_FLAG}-RUN if [ -z "$RELEASE_FLAG" ]; then mv /tmp/ballista/ballista/rust/target/debug/tpch /tpch; else mv /tmp/ballista/ballista/rust/target/release/tpch /tpch; fi+RUN if [ -z "$RELEASE_FLAG" ]; then mv /tmp/ballista/target/debug/tpch /tpch; else mv /tmp/ballista/target/release/tpch /tpch; fi# Copy the binary into a new container for a smaller docker imageFROM ballistacompute/rust-base:0.4.0-20210213