diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 501b05c25d8e..c94137ebd1f9 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 d56d37ad2b35..cccca0174113 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.72" version = "35.0.0" [workspace.dependencies] diff --git a/benchmarks/Cargo.toml b/benchmarks/Cargo.toml index 50b79b4b0661..ced77c73f593 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 = { workspace = true } [features] ci = [] diff --git a/datafusion-cli/Cargo.toml b/datafusion-cli/Cargo.toml index 07ee65e3f6cd..79a1f0162e6a 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.70" +# 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 f9a4c54b7dc6..2d795d0f8369 100644 --- a/datafusion/core/Cargo.toml +++ b/datafusion/core/Cargo.toml @@ -27,7 +27,10 @@ homepage = { workspace = true } repository = { workspace = true } license = { workspace = true } authors = { workspace = true } -rust-version = "1.70" +# 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] name = "datafusion" diff --git a/datafusion/expr/src/expr.rs b/datafusion/expr/src/expr.rs index 9da1f4bb4df7..0000f3df033a 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; @@ -853,13 +853,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 a0d55ca71db1..657a7b9f7f21 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. diff --git a/datafusion/proto/Cargo.toml b/datafusion/proto/Cargo.toml index 2eaf25198734..cdd464f38a76 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 = "1.70" +# 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 8b3f3f98a8a1..c80bd50af287 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.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 a4d18e0d35fd..38414fc5e67a 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 = "1.70" +# Specify MSRV here as `cargo msrv` doesn't support workspace version +rust-version = "1.72" [dependencies] async-recursion = "1.0" diff --git a/datafusion/wasmtest/Cargo.toml b/datafusion/wasmtest/Cargo.toml index 91af15a6ea62..c47dcf83c84b 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 = { workspace = true } [lib] crate-type = ["cdylib", "rlib"] diff --git a/docs/Cargo.toml b/docs/Cargo.toml index 3a8c90cae085..7eecd11df80b 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 = { workspace = true } [dependencies] datafusion = { path = "../datafusion/core", version = "35.0.0", default-features = false }