Skip to content
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

chore: Upgrade to DataFusion 43.0.0-rc1 #1057

Merged
merged 6 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
140 changes: 72 additions & 68 deletions native/Cargo.lock

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions native/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,23 @@ license = "Apache-2.0"
edition = "2021"

# Comet uses the same minimum Rust version as DataFusion
rust-version = "1.75"
rust-version = "1.79"

[workspace.dependencies]
arrow = { version = "53.1.0", features = ["prettyprint", "ffi", "chrono-tz"] }
arrow-array = { version = "53.1.0" }
arrow-buffer = { version = "53.1.0" }
arrow-data = { version = "53.1.0" }
arrow-schema = { version = "53.1.0" }
parquet = { version = "53.1.0", default-features = false, features = ["experimental"] }
datafusion-common = { git = "https://github.com/apache/datafusion.git", rev = "3b6aac2" }
datafusion = { git = "https://github.com/apache/datafusion.git", rev = "3b6aac2", default-features = false, features = ["unicode_expressions", "crypto_expressions"] }
datafusion-functions = { git = "https://github.com/apache/datafusion.git", rev = "3b6aac2", features = ["crypto_expressions"] }
datafusion-functions-nested = { git = "https://github.com/apache/datafusion.git", rev = "3b6aac2", default-features = false }
datafusion-expr = { git = "https://github.com/apache/datafusion.git", rev = "3b6aac2", default-features = false }
datafusion-execution = { git = "https://github.com/apache/datafusion.git", rev = "3b6aac2", default-features = false }
datafusion-physical-plan = { git = "https://github.com/apache/datafusion.git", rev = "3b6aac2", default-features = false }
datafusion-physical-expr = { git = "https://github.com/apache/datafusion.git", rev = "3b6aac2", default-features = false }
arrow = { version = "53.2.0", features = ["prettyprint", "ffi", "chrono-tz"] }
arrow-array = { version = "53.2.0" }
arrow-buffer = { version = "53.2.0" }
arrow-data = { version = "53.2.0" }
arrow-schema = { version = "53.2.0" }
parquet = { version = "53.2.0", default-features = false, features = ["experimental"] }
datafusion-common = { git = "https://github.com/apache/datafusion.git", rev = "43.0.0-rc1" }
datafusion = { git = "https://github.com/apache/datafusion.git", rev = "43.0.0-rc1", default-features = false, features = ["unicode_expressions", "crypto_expressions"] }
datafusion-functions = { git = "https://github.com/apache/datafusion.git", rev = "43.0.0-rc1", features = ["crypto_expressions"] }
datafusion-functions-nested = { git = "https://github.com/apache/datafusion.git", rev = "43.0.0-rc1", default-features = false }
datafusion-expr = { git = "https://github.com/apache/datafusion.git", rev = "43.0.0-rc1", default-features = false }
datafusion-execution = { git = "https://github.com/apache/datafusion.git", rev = "43.0.0-rc1", default-features = false }
datafusion-physical-plan = { git = "https://github.com/apache/datafusion.git", rev = "43.0.0-rc1", default-features = false }
datafusion-physical-expr = { git = "https://github.com/apache/datafusion.git", rev = "43.0.0-rc1", default-features = false }
datafusion-comet-spark-expr = { path = "spark-expr", version = "0.4.0" }
datafusion-comet-proto = { path = "proto", version = "0.4.0" }
chrono = { version = "0.4", default-features = false, features = ["clock"] }
Expand Down
2 changes: 1 addition & 1 deletion native/core/benches/aggregate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ fn create_aggregate(
AggregateExec::try_new(
AggregateMode::Partial,
PhysicalGroupBy::new_single(vec![(c0, "c0".to_string())]),
vec![aggr_expr],
vec![aggr_expr.into()],
vec![None], // no filter expressions
scan,
Arc::clone(schema),
Expand Down
2 changes: 1 addition & 1 deletion native/core/benches/bloom_filter_agg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ fn create_aggregate(
AggregateExec::try_new(
mode,
PhysicalGroupBy::new_single(vec![]),
vec![aggr_expr],
vec![aggr_expr.into()],
vec![None],
scan,
Arc::clone(schema),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ mod tests {
let aggregate = Arc::new(AggregateExec::try_new(
AggregateMode::Partial,
PhysicalGroupBy::new_single(vec![(c0, "c0".to_string())]),
vec![aggr_expr],
vec![aggr_expr.into()],
vec![None], // no filter expressions
scan,
Arc::clone(&schema),
Expand Down
6 changes: 4 additions & 2 deletions native/core/src/execution/datafusion/planner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ use datafusion_expr::{
};
use datafusion_physical_expr::expressions::{Literal, StatsType};
use datafusion_physical_expr::window::WindowExpr;
use datafusion_physical_expr::LexOrdering;
use itertools::Itertools;
use jni::objects::GlobalRef;
use num::{BigInt, ToPrimitive};
Expand Down Expand Up @@ -873,11 +874,12 @@ impl PhysicalPlanner {
.collect();

let num_agg = agg.agg_exprs.len();
let aggr_expr = agg_exprs?.into_iter().map(Arc::new).collect();
let aggregate = Arc::new(
datafusion::physical_plan::aggregates::AggregateExec::try_new(
mode,
group_by,
agg_exprs?,
aggr_expr,
vec![None; num_agg], // no filter expressions
Arc::clone(&child),
Arc::clone(&schema),
Expand Down Expand Up @@ -935,7 +937,7 @@ impl PhysicalPlanner {

Ok((
scans,
Arc::new(SortExec::new(exprs?, child).with_fetch(fetch)),
Arc::new(SortExec::new(LexOrdering::new(exprs?), child).with_fetch(fetch)),
))
}
OpStruct::Scan(scan) => {
Expand Down
8 changes: 6 additions & 2 deletions native/spark-expr/src/scalar_funcs/hash_expressions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use crate::scalar_funcs::hex::hex_strings;
use crate::spark_hash::{create_murmur3_hashes, create_xxhash64_hashes};

use arrow_array::{ArrayRef, Int32Array, Int64Array, StringArray};
use arrow_array::{Array, ArrayRef, Int32Array, Int64Array, StringArray};
use datafusion::functions::crypto::{sha224, sha256, sha384, sha512};
use datafusion_common::cast::as_binary_array;
use datafusion_common::{exec_err, internal_err, DataFusionError, ScalarValue};
Expand Down Expand Up @@ -139,7 +139,11 @@ fn wrap_digest_result_as_hex_string(
args: &[ColumnarValue],
digest: Arc<ScalarUDF>,
) -> Result<ColumnarValue, DataFusionError> {
let value = digest.invoke(args)?;
let row_count = match &args[0] {
ColumnarValue::Array(array) => array.len(),
ColumnarValue::Scalar(_) => 1,
};
let value = digest.invoke_batch(args, row_count)?;
match value {
ColumnarValue::Array(array) => {
let binary_array = as_binary_array(&array)?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,8 @@ class CometJoinSuite extends CometTestBase {
}
}

test("SortMergeJoin with join filter") {
// https://github.com/apache/datafusion-comet/issues/398
ignore("SortMergeJoin with join filter") {
withSQLConf(
CometConf.COMET_EXEC_SORT_MERGE_JOIN_WITH_JOIN_FILTER_ENABLED.key -> "true",
SQLConf.ADAPTIVE_AUTO_BROADCASTJOIN_THRESHOLD.key -> "-1",
Expand Down
Loading