Skip to content

Apache DataFusion SQL Query Engine

Update arrow-rs to 6.4.0 and replace boolean comparison in datafusion with arrow compute kernel (#1446)

xudong.we1cfa4188d5d
diff --git a/ballista/rust/core/Cargo.toml b/ballista/rust/core/Cargo.toml
index 662ced0c4e..84679d596d 100644
--- a/ballista/rust/core/Cargo.toml
+++ b/ballista/rust/core/Cargo.toml
@@ -43,7 +43,7 @@ tonic = "0.5"
uuid = { version = "0.8", features = ["v4"] }
chrono = "0.4"
-arrow-flight = { version = "6.3.0" }
+arrow-flight = { version = "6.4.0" }
datafusion = { path = "../../../datafusion", version = "6.0.0" }
diff --git a/ballista/rust/executor/Cargo.toml b/ballista/rust/executor/Cargo.toml
index 6717a0a12f..00f3aab745 100644
--- a/ballista/rust/executor/Cargo.toml
+++ b/ballista/rust/executor/Cargo.toml
@@ -29,8 +29,8 @@ edition = "2018"
snmalloc = ["snmalloc-rs"]
[dependencies]
-arrow = { version = "6.3.0" }
-arrow-flight = { version = "6.3.0" }
+arrow = { version = "6.4.0" }
+arrow-flight = { version = "6.4.0" }
anyhow = "1"
async-trait = "0.1.36"
ballista-core = { path = "../core", version = "0.6.0" }
diff --git a/datafusion-cli/Cargo.toml b/datafusion-cli/Cargo.toml
index 27227507db..394bd1e3a2 100644
--- a/datafusion-cli/Cargo.toml
+++ b/datafusion-cli/Cargo.toml
@@ -31,5 +31,5 @@ clap = "2.33"
rustyline = "9.0"
tokio = { version = "1.0", features = ["macros", "rt", "rt-multi-thread", "sync"] }
datafusion = { path = "../datafusion", version = "6.0.0" }
-arrow = { version = "6.3.0" }
+arrow = { version = "6.4.0" }
ballista = { path = "../ballista/rust/client", version = "0.6.0" }
diff --git a/datafusion-examples/Cargo.toml b/datafusion-examples/Cargo.toml
index d81100f70a..f7ef66d99b 100644
--- a/datafusion-examples/Cargo.toml
+++ b/datafusion-examples/Cargo.toml
@@ -34,7 +34,7 @@ path = "examples/avro_sql.rs"
required-features = ["datafusion/avro"]
[dev-dependencies]
-arrow-flight = { version = "6.3.0" }
+arrow-flight = { version = "6.4.0" }
datafusion = { path = "../datafusion" }
prost = "0.8"
tonic = "0.5"
diff --git a/datafusion/Cargo.toml b/datafusion/Cargo.toml
index a8c075ea7a..fadc9aba91 100644
--- a/datafusion/Cargo.toml
+++ b/datafusion/Cargo.toml
@@ -52,8 +52,8 @@ avro = ["avro-rs", "num-traits"]
[dependencies]
ahash = "0.7"
hashbrown = { version = "0.11", features = ["raw"] }
-arrow = { version = "6.3.0", features = ["prettyprint"] }
-parquet = { version = "6.3.0", features = ["arrow"] }
+arrow = { version = "6.4.0", features = ["prettyprint"] }
+parquet = { version = "6.4.0", features = ["arrow"] }
sqlparser = "0.13"
paste = "^1.0"
num_cpus = "1.13.0"
diff --git a/datafusion/src/physical_plan/expressions/binary.rs b/datafusion/src/physical_plan/expressions/binary.rs
index 92d2a8b4fb..d8bae7d179 100644
--- a/datafusion/src/physical_plan/expressions/binary.rs
+++ b/datafusion/src/physical_plan/expressions/binary.rs
@@ -25,8 +25,8 @@ use arrow::compute::kernels::arithmetic::{
use arrow::compute::kernels::boolean::{and_kleene, not, or_kleene};
use arrow::compute::kernels::comparison::{eq, gt, gt_eq, lt, lt_eq, neq};
use arrow::compute::kernels::comparison::{
- eq_bool, eq_bool_scalar, gt_bool, gt_eq_bool, lt_bool, lt_eq_bool, neq_bool,
- neq_bool_scalar,
+ eq_bool, eq_bool_scalar, gt_bool, gt_bool_scalar, gt_eq_bool, gt_eq_bool_scalar,
+ lt_bool, lt_bool_scalar, lt_eq_bool, lt_eq_bool_scalar, neq_bool, neq_bool_scalar,
};
use arrow::compute::kernels::comparison::{
eq_scalar, gt_eq_scalar, gt_scalar, lt_eq_scalar, lt_scalar, neq_scalar,
@@ -79,38 +79,6 @@ fn is_not_distinct_from_bool(
.collect())
}
-// TODO use arrow-rs kernels when available. See
-// https://github.com/apache/arrow-rs/issues/959
-#[allow(clippy::bool_comparison)]
-fn lt_bool_scalar(left: &BooleanArray, right: bool) -> Result<BooleanArray> {
- Ok(left
- .iter()
- .map(|left| left.map(|left| left < right))
- .collect())
-}
-
-fn lt_eq_bool_scalar(left: &BooleanArray, right: bool) -> Result<BooleanArray> {
- Ok(left
- .iter()
- .map(|left| left.map(|left| left <= right))
- .collect())
-}
-
-#[allow(clippy::bool_comparison)]
-fn gt_bool_scalar(left: &BooleanArray, right: bool) -> Result<BooleanArray> {
- Ok(left
- .iter()
- .map(|left| left.map(|left| left > right))
- .collect())
-}
-
-fn gt_eq_bool_scalar(left: &BooleanArray, right: bool) -> Result<BooleanArray> {
- Ok(left
- .iter()
- .map(|left| left.map(|left| left >= right))
- .collect())
-}
-
/// Binary expression
#[derive(Debug)]
pub struct BinaryExpr {