From fc40314299a74af5a2a61890fd12abe6bd035d60 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Thu, 25 Jan 2024 08:02:49 -0500 Subject: [PATCH 1/6] Update minimum rust version to 1.71 --- Cargo.toml | 2 +- benchmarks/Cargo.toml | 2 +- datafusion-cli/Cargo.toml | 2 +- datafusion/core/Cargo.toml | 2 +- datafusion/proto/Cargo.toml | 2 +- datafusion/substrait/Cargo.toml | 2 +- datafusion/wasmtest/Cargo.toml | 2 +- docs/Cargo.toml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index cd88e18fe17cb..5ecc061b0b6d1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,7 @@ homepage = "https://github.com/apache/arrow-datafusion" license = "Apache-2.0" readme = "README.md" repository = "https://github.com/apache/arrow-datafusion" -rust-version = "1.70" +rust-version = "1.71" version = "35.0.0" [workspace.dependencies] diff --git a/benchmarks/Cargo.toml b/benchmarks/Cargo.toml index 50b79b4b0661e..0f2a43357bdfd 100644 --- a/benchmarks/Cargo.toml +++ b/benchmarks/Cargo.toml @@ -24,7 +24,7 @@ authors = ["Apache Arrow "] homepage = "https://github.com/apache/arrow-datafusion" repository = "https://github.com/apache/arrow-datafusion" license = "Apache-2.0" -rust-version = "1.70" +rust-version = "1.71" [features] ci = [] diff --git a/datafusion-cli/Cargo.toml b/datafusion-cli/Cargo.toml index 07ee65e3f6cd6..2a2482cf512b0 100644 --- a/datafusion-cli/Cargo.toml +++ b/datafusion-cli/Cargo.toml @@ -25,7 +25,7 @@ keywords = ["arrow", "datafusion", "query", "sql"] license = "Apache-2.0" homepage = "https://github.com/apache/arrow-datafusion" repository = "https://github.com/apache/arrow-datafusion" -rust-version = "1.70" +rust-version = "1.71" readme = "README.md" [dependencies] diff --git a/datafusion/core/Cargo.toml b/datafusion/core/Cargo.toml index 69b18a326951b..85d3860a82543 100644 --- a/datafusion/core/Cargo.toml +++ b/datafusion/core/Cargo.toml @@ -27,7 +27,7 @@ homepage = { workspace = true } repository = { workspace = true } license = { workspace = true } authors = { workspace = true } -rust-version = "1.70" +rust-version = "1.71" [lib] name = "datafusion" diff --git a/datafusion/proto/Cargo.toml b/datafusion/proto/Cargo.toml index f9d54dba57566..ee2ad57a6d40a 100644 --- a/datafusion/proto/Cargo.toml +++ b/datafusion/proto/Cargo.toml @@ -26,7 +26,7 @@ homepage = { workspace = true } repository = { workspace = true } license = { workspace = true } authors = { workspace = true } -rust-version = "1.70" +rust-version = "1.71" # Exclude proto files so crates.io consumers don't need protoc exclude = ["*.proto"] diff --git a/datafusion/substrait/Cargo.toml b/datafusion/substrait/Cargo.toml index 772ba11ed4f60..b8d28dca7baa3 100644 --- a/datafusion/substrait/Cargo.toml +++ b/datafusion/substrait/Cargo.toml @@ -25,7 +25,7 @@ homepage = { workspace = true } repository = { workspace = true } license = { workspace = true } authors = { workspace = true } -rust-version = "1.70" +rust-version = "1.71" [dependencies] async-recursion = "1.0" diff --git a/datafusion/wasmtest/Cargo.toml b/datafusion/wasmtest/Cargo.toml index 91af15a6ea62a..cd1b0a1341d0e 100644 --- a/datafusion/wasmtest/Cargo.toml +++ b/datafusion/wasmtest/Cargo.toml @@ -25,7 +25,7 @@ homepage = { workspace = true } repository = { workspace = true } license = { workspace = true } authors = { workspace = true } -rust-version = "1.70" +rust-version = "1.71" [lib] crate-type = ["cdylib", "rlib"] diff --git a/docs/Cargo.toml b/docs/Cargo.toml index 3a8c90cae0858..e3a116f878676 100644 --- a/docs/Cargo.toml +++ b/docs/Cargo.toml @@ -26,7 +26,7 @@ homepage = { workspace = true } repository = { workspace = true } license = { workspace = true } authors = { workspace = true } -rust-version = "1.70" +rust-version = "1.71" [dependencies] datafusion = { path = "../datafusion/core", version = "35.0.0", default-features = false } From c6f8d168dc80a4aa36506651ff0fefafe9173d9a Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Thu, 25 Jan 2024 13:31:51 -0500 Subject: [PATCH 2/6] Fix clippy lint about hasher --- datafusion/expr/src/expr.rs | 11 +++-------- datafusion/physical-expr/src/aggregate/hyperloglog.rs | 8 +++----- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/datafusion/expr/src/expr.rs b/datafusion/expr/src/expr.rs index c5d158d876385..39e4c1230d288 100644 --- a/datafusion/expr/src/expr.rs +++ b/datafusion/expr/src/expr.rs @@ -33,7 +33,7 @@ use datafusion_common::{plan_err, Column, DataFusionError, Result, ScalarValue}; use std::collections::HashSet; use std::fmt; use std::fmt::{Display, Formatter, Write}; -use std::hash::{BuildHasher, Hash, Hasher}; +use std::hash::Hash; use std::str::FromStr; use std::sync::Arc; @@ -849,13 +849,8 @@ const SEED: ahash::RandomState = ahash::RandomState::with_seeds(0, 0, 0, 0); impl PartialOrd for Expr { fn partial_cmp(&self, other: &Self) -> Option { - let mut hasher = SEED.build_hasher(); - self.hash(&mut hasher); - let s = hasher.finish(); - - let mut hasher = SEED.build_hasher(); - other.hash(&mut hasher); - let o = hasher.finish(); + let s = SEED.hash_one(self); + let o = SEED.hash_one(other); Some(s.cmp(&o)) } diff --git a/datafusion/physical-expr/src/aggregate/hyperloglog.rs b/datafusion/physical-expr/src/aggregate/hyperloglog.rs index a0d55ca71db14..657a7b9f7f219 100644 --- a/datafusion/physical-expr/src/aggregate/hyperloglog.rs +++ b/datafusion/physical-expr/src/aggregate/hyperloglog.rs @@ -34,8 +34,8 @@ //! //! This module also borrows some code structure from [pdatastructs.rs](https://github.com/crepererum/pdatastructs.rs/blob/3997ed50f6b6871c9e53c4c5e0f48f431405fc63/src/hyperloglog.rs). -use ahash::{AHasher, RandomState}; -use std::hash::{BuildHasher, Hash, Hasher}; +use ahash::RandomState; +use std::hash::Hash; use std::marker::PhantomData; /// The greater is P, the smaller the error. @@ -102,9 +102,7 @@ where /// reasonable performance. #[inline] fn hash_value(&self, obj: &T) -> u64 { - let mut hasher: AHasher = SEED.build_hasher(); - obj.hash(&mut hasher); - hasher.finish() + SEED.hash_one(obj) } /// Adds an element to the HyperLogLog. From 9280b7a166814bc6f3660c7471fb9858ac8bde3a Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Mon, 29 Jan 2024 17:27:08 -0500 Subject: [PATCH 3/6] Use workspace MSRV --- benchmarks/Cargo.toml | 2 +- datafusion/core/Cargo.toml | 2 +- datafusion/proto/Cargo.toml | 2 +- datafusion/proto/gen/Cargo.toml | 2 +- datafusion/substrait/Cargo.toml | 2 +- datafusion/wasmtest/Cargo.toml | 2 +- docs/Cargo.toml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmarks/Cargo.toml b/benchmarks/Cargo.toml index 0f2a43357bdfd..ced77c73f5934 100644 --- a/benchmarks/Cargo.toml +++ b/benchmarks/Cargo.toml @@ -24,7 +24,7 @@ authors = ["Apache Arrow "] homepage = "https://github.com/apache/arrow-datafusion" repository = "https://github.com/apache/arrow-datafusion" license = "Apache-2.0" -rust-version = "1.71" +rust-version = { workspace = true } [features] ci = [] diff --git a/datafusion/core/Cargo.toml b/datafusion/core/Cargo.toml index 85d3860a82543..733da21957429 100644 --- a/datafusion/core/Cargo.toml +++ b/datafusion/core/Cargo.toml @@ -27,7 +27,7 @@ homepage = { workspace = true } repository = { workspace = true } license = { workspace = true } authors = { workspace = true } -rust-version = "1.71" +rust-version = { workspace = true } [lib] name = "datafusion" diff --git a/datafusion/proto/Cargo.toml b/datafusion/proto/Cargo.toml index ee2ad57a6d40a..b7a46fecf4d00 100644 --- a/datafusion/proto/Cargo.toml +++ b/datafusion/proto/Cargo.toml @@ -26,7 +26,7 @@ homepage = { workspace = true } repository = { workspace = true } license = { workspace = true } authors = { workspace = true } -rust-version = "1.71" +rust-version = { workspace = true } # Exclude proto files so crates.io consumers don't need protoc exclude = ["*.proto"] diff --git a/datafusion/proto/gen/Cargo.toml b/datafusion/proto/gen/Cargo.toml index 8b3f3f98a8a1d..1494b8fdb69fe 100644 --- a/datafusion/proto/gen/Cargo.toml +++ b/datafusion/proto/gen/Cargo.toml @@ -20,7 +20,7 @@ name = "gen" description = "Code generation for proto" version = "0.1.0" edition = { workspace = true } -rust-version = "1.64" +rust-version = "1.71" authors = ["Apache Arrow "] homepage = "https://github.com/apache/arrow-datafusion" repository = "https://github.com/apache/arrow-datafusion" diff --git a/datafusion/substrait/Cargo.toml b/datafusion/substrait/Cargo.toml index b8d28dca7baa3..5e504cbe7bacb 100644 --- a/datafusion/substrait/Cargo.toml +++ b/datafusion/substrait/Cargo.toml @@ -25,7 +25,7 @@ homepage = { workspace = true } repository = { workspace = true } license = { workspace = true } authors = { workspace = true } -rust-version = "1.71" +rust-version = { workspace = true } [dependencies] async-recursion = "1.0" diff --git a/datafusion/wasmtest/Cargo.toml b/datafusion/wasmtest/Cargo.toml index cd1b0a1341d0e..c47dcf83c84b2 100644 --- a/datafusion/wasmtest/Cargo.toml +++ b/datafusion/wasmtest/Cargo.toml @@ -25,7 +25,7 @@ homepage = { workspace = true } repository = { workspace = true } license = { workspace = true } authors = { workspace = true } -rust-version = "1.71" +rust-version = { workspace = true } [lib] crate-type = ["cdylib", "rlib"] diff --git a/docs/Cargo.toml b/docs/Cargo.toml index e3a116f878676..7eecd11df80bd 100644 --- a/docs/Cargo.toml +++ b/docs/Cargo.toml @@ -26,7 +26,7 @@ homepage = { workspace = true } repository = { workspace = true } license = { workspace = true } authors = { workspace = true } -rust-version = "1.71" +rust-version = { workspace = true } [dependencies] datafusion = { path = "../datafusion/core", version = "35.0.0", default-features = false } From e9ec7666b8939a04ee9b761a76911357470acce5 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Wed, 31 Jan 2024 07:33:19 -0500 Subject: [PATCH 4/6] Update to 1.72 and fix checks --- .github/workflows/rust.yml | 6 +++++- Cargo.toml | 2 +- datafusion-cli/Cargo.toml | 3 ++- datafusion/core/Cargo.toml | 4 +++- datafusion/proto/Cargo.toml | 3 ++- datafusion/proto/gen/Cargo.toml | 2 +- datafusion/substrait/Cargo.toml | 3 ++- 7 files changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 501b05c25d8ed..c94137ebd1f91 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -492,7 +492,11 @@ jobs: ./dev/update_config_docs.sh git diff --exit-code - # Verify MSRV for the crates which are directly used by other projects. + # Verify MSRV for the crates which are directly used by other projects: + # - datafusion + # - datafusion-substrait + # - datafusion-proto + # - datafusion-cli msrv: name: Verify MSRV (Min Supported Rust Version) runs-on: ubuntu-latest diff --git a/Cargo.toml b/Cargo.toml index 963298094ca57..cccca01741135 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,7 @@ homepage = "https://github.com/apache/arrow-datafusion" license = "Apache-2.0" readme = "README.md" repository = "https://github.com/apache/arrow-datafusion" -rust-version = "1.71" +rust-version = "1.72" version = "35.0.0" [workspace.dependencies] diff --git a/datafusion-cli/Cargo.toml b/datafusion-cli/Cargo.toml index 2a2482cf512b0..79a1f0162e6a2 100644 --- a/datafusion-cli/Cargo.toml +++ b/datafusion-cli/Cargo.toml @@ -25,7 +25,8 @@ keywords = ["arrow", "datafusion", "query", "sql"] license = "Apache-2.0" homepage = "https://github.com/apache/arrow-datafusion" repository = "https://github.com/apache/arrow-datafusion" -rust-version = "1.71" +# Specify MSRV here as `cargo msrv` doesn't support workspace version +rust-version = "1.72" readme = "README.md" [dependencies] diff --git a/datafusion/core/Cargo.toml b/datafusion/core/Cargo.toml index 558111d27b0fb..a2aa88c6321ec 100644 --- a/datafusion/core/Cargo.toml +++ b/datafusion/core/Cargo.toml @@ -27,7 +27,9 @@ homepage = { workspace = true } repository = { workspace = true } license = { workspace = true } authors = { workspace = true } -rust-version = { workspace = true } +# Specify MSRV here as `cargo msrv` doesn't support workspace version and fails with +# "Unable to find key 'package.rust-version' (or 'package.metadata.msrv') in 'arrow-datafusion/Cargo.toml'" +rust-version = "1.72" [lib] name = "datafusion" diff --git a/datafusion/proto/Cargo.toml b/datafusion/proto/Cargo.toml index f377021b5480c..cdd464f38a76d 100644 --- a/datafusion/proto/Cargo.toml +++ b/datafusion/proto/Cargo.toml @@ -26,7 +26,8 @@ homepage = { workspace = true } repository = { workspace = true } license = { workspace = true } authors = { workspace = true } -rust-version = { workspace = true } +# Specify MSRV here as `cargo msrv` doesn't support workspace version +rust-version = "1.72" # Exclude proto files so crates.io consumers don't need protoc exclude = ["*.proto"] diff --git a/datafusion/proto/gen/Cargo.toml b/datafusion/proto/gen/Cargo.toml index 1494b8fdb69fe..c80bd50af287d 100644 --- a/datafusion/proto/gen/Cargo.toml +++ b/datafusion/proto/gen/Cargo.toml @@ -20,7 +20,7 @@ name = "gen" description = "Code generation for proto" version = "0.1.0" edition = { workspace = true } -rust-version = "1.71" +rust-version = "1.72" authors = ["Apache Arrow "] homepage = "https://github.com/apache/arrow-datafusion" repository = "https://github.com/apache/arrow-datafusion" diff --git a/datafusion/substrait/Cargo.toml b/datafusion/substrait/Cargo.toml index b1cd19d5e7416..323475d13e831 100644 --- a/datafusion/substrait/Cargo.toml +++ b/datafusion/substrait/Cargo.toml @@ -25,7 +25,8 @@ homepage = { workspace = true } repository = { workspace = true } license = { workspace = true } authors = { workspace = true } -rust-version = { workspace = true } +# Specify MSRV here as `cargo msrv` doesn't support workspace version +rust-version = "1.70" [dependencies] async-recursion = "1.0" From 681bb5b473f04bfbade6871519e01451ee30daaa Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Wed, 31 Jan 2024 07:42:07 -0500 Subject: [PATCH 5/6] fix substrait --- datafusion/substrait/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datafusion/substrait/Cargo.toml b/datafusion/substrait/Cargo.toml index 323475d13e831..38414fc5e67a2 100644 --- a/datafusion/substrait/Cargo.toml +++ b/datafusion/substrait/Cargo.toml @@ -26,7 +26,7 @@ repository = { workspace = true } license = { workspace = true } authors = { workspace = true } # Specify MSRV here as `cargo msrv` doesn't support workspace version -rust-version = "1.70" +rust-version = "1.72" [dependencies] async-recursion = "1.0" From e7b6739c604aa250d3d35eed15e361ef6b407de0 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Wed, 31 Jan 2024 14:58:42 -0500 Subject: [PATCH 6/6] Update datafusion/core/Cargo.toml --- datafusion/core/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/datafusion/core/Cargo.toml b/datafusion/core/Cargo.toml index a2aa88c6321ec..2d795d0f8369a 100644 --- a/datafusion/core/Cargo.toml +++ b/datafusion/core/Cargo.toml @@ -29,6 +29,7 @@ license = { workspace = true } authors = { workspace = true } # Specify MSRV here as `cargo msrv` doesn't support workspace version and fails with # "Unable to find key 'package.rust-version' (or 'package.metadata.msrv') in 'arrow-datafusion/Cargo.toml'" +# https://github.com/foresterre/cargo-msrv/issues/590 rust-version = "1.72" [lib]