This is an automated email from the ASF dual-hosted git repository.
dheres pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git
The following commit(s) were added to refs/heads/master by this push:
new fbdb6f420 Update `ahash` requirement from 0.7 to 0.8 (#3161)
fbdb6f420 is described below
commit fbdb6f420ecd8701a8d9cba07b4920577019a137
Author: Andrew Lamb <[email protected]>
AuthorDate: Tue Aug 16 13:29:32 2022 -0400
Update `ahash` requirement from 0.7 to 0.8 (#3161)
* Update ahash requirement from 0.7 to 0.8
Updates the requirements on [ahash](https://github.com/tkaitchuck/ahash) to
permit the latest version.
- [Release notes](https://github.com/tkaitchuck/ahash/releases)
- [Commits](https://github.com/tkaitchuck/ahash/compare/v0.7.6...v0.8.0)
---
updated-dependencies:
- dependency-name: ahash
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <[email protected]>
* Update to new API
* Fix cargo.toml formatting
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot]
<49699333+dependabot[bot]@users.noreply.github.com>
---
datafusion/core/Cargo.toml | 2 +-
datafusion/core/src/physical_plan/hash_utils.rs | 60 ++++++++++---------------
datafusion/expr/Cargo.toml | 2 +-
datafusion/physical-expr/Cargo.toml | 2 +-
datafusion/sql/Cargo.toml | 2 +-
5 files changed, 28 insertions(+), 40 deletions(-)
diff --git a/datafusion/core/Cargo.toml b/datafusion/core/Cargo.toml
index 7e6924303..189e53d63 100644
--- a/datafusion/core/Cargo.toml
+++ b/datafusion/core/Cargo.toml
@@ -54,7 +54,7 @@ simd = ["arrow/simd"]
unicode_expressions = ["datafusion-physical-expr/regex_expressions",
"datafusion-sql/unicode_expressions"]
[dependencies]
-ahash = { version = "0.7", default-features = false }
+ahash = { version = "0.8", default-features = false, features =
["runtime-rng"] }
apache-avro = { version = "0.14", optional = true }
arrow = { version = "20.0.0", features = ["prettyprint"] }
async-trait = "0.1.41"
diff --git a/datafusion/core/src/physical_plan/hash_utils.rs
b/datafusion/core/src/physical_plan/hash_utils.rs
index ba6dda51d..bdf99fb4f 100644
--- a/datafusion/core/src/physical_plan/hash_utils.rs
+++ b/datafusion/core/src/physical_plan/hash_utils.rs
@@ -18,7 +18,7 @@
//! Functionality used both on logical and physical plans
use crate::error::{DataFusionError, Result};
-use ahash::{CallHasher, RandomState};
+use ahash::RandomState;
use arrow::array::{
Array, ArrayRef, BasicDecimalArray, BooleanArray, Date32Array, Date64Array,
Decimal128Array, DictionaryArray, Float32Array, Float64Array, Int16Array,
Int32Array,
@@ -43,11 +43,11 @@ fn hash_null(random_state: &RandomState, hashes_buffer: &'_
mut [u64], mul_col:
if mul_col {
hashes_buffer.iter_mut().for_each(|hash| {
// stable hash for null value
- *hash = combine_hashes(i128::get_hash(&1, random_state), *hash);
+ *hash = combine_hashes(random_state.hash_one(&1), *hash);
})
} else {
hashes_buffer.iter_mut().for_each(|hash| {
- *hash = i128::get_hash(&1, random_state);
+ *hash = random_state.hash_one(&1);
})
}
}
@@ -63,20 +63,20 @@ fn hash_decimal128<'a>(
if mul_col {
for (i, hash) in hashes_buffer.iter_mut().enumerate() {
*hash = combine_hashes(
- i128::get_hash(&array.value(i).as_i128(), random_state),
+ random_state.hash_one(&array.value(i).as_i128()),
*hash,
);
}
} else {
for (i, hash) in hashes_buffer.iter_mut().enumerate() {
- *hash = i128::get_hash(&array.value(i).as_i128(),
random_state);
+ *hash = random_state.hash_one(&array.value(i).as_i128());
}
}
} else if mul_col {
for (i, hash) in hashes_buffer.iter_mut().enumerate() {
if !array.is_null(i) {
*hash = combine_hashes(
- i128::get_hash(&array.value(i).as_i128(), random_state),
+ random_state.hash_one(&array.value(i).as_i128()),
*hash,
);
}
@@ -84,7 +84,7 @@ fn hash_decimal128<'a>(
} else {
for (i, hash) in hashes_buffer.iter_mut().enumerate() {
if !array.is_null(i) {
- *hash = i128::get_hash(&array.value(i).as_i128(),
random_state);
+ *hash = random_state.hash_one(&array.value(i).as_i128());
}
}
}
@@ -96,14 +96,12 @@ macro_rules! hash_array {
if array.null_count() == 0 {
if $multi_col {
for (i, hash) in $hashes.iter_mut().enumerate() {
- *hash = combine_hashes(
- <$ty>::get_hash(&array.value(i), $random_state),
- *hash,
- );
+ *hash =
+
combine_hashes($random_state.hash_one(&array.value(i)), *hash);
}
} else {
for (i, hash) in $hashes.iter_mut().enumerate() {
- *hash = <$ty>::get_hash(&array.value(i), $random_state);
+ *hash = $random_state.hash_one(&array.value(i));
}
}
} else {
@@ -111,7 +109,7 @@ macro_rules! hash_array {
for (i, hash) in $hashes.iter_mut().enumerate() {
if !array.is_null(i) {
*hash = combine_hashes(
- <$ty>::get_hash(&array.value(i), $random_state),
+ $random_state.hash_one(&array.value(i)),
*hash,
);
}
@@ -119,7 +117,7 @@ macro_rules! hash_array {
} else {
for (i, hash) in $hashes.iter_mut().enumerate() {
if !array.is_null(i) {
- *hash = <$ty>::get_hash(&array.value(i),
$random_state);
+ *hash = $random_state.hash_one(&array.value(i));
}
}
}
@@ -135,11 +133,11 @@ macro_rules! hash_array_primitive {
if array.null_count() == 0 {
if $multi_col {
for (hash, value) in $hashes.iter_mut().zip(values.iter()) {
- *hash = combine_hashes($ty::get_hash(value,
$random_state), *hash);
+ *hash = combine_hashes($random_state.hash_one(value),
*hash);
}
} else {
for (hash, value) in $hashes.iter_mut().zip(values.iter()) {
- *hash = $ty::get_hash(value, $random_state)
+ *hash = $random_state.hash_one(value)
}
}
} else {
@@ -148,8 +146,7 @@ macro_rules! hash_array_primitive {
$hashes.iter_mut().zip(values.iter()).enumerate()
{
if !array.is_null(i) {
- *hash =
- combine_hashes($ty::get_hash(value,
$random_state), *hash);
+ *hash = combine_hashes($random_state.hash_one(value),
*hash);
}
}
} else {
@@ -157,7 +154,7 @@ macro_rules! hash_array_primitive {
$hashes.iter_mut().zip(values.iter()).enumerate()
{
if !array.is_null(i) {
- *hash = $ty::get_hash(value, $random_state);
+ *hash = $random_state.hash_one(value);
}
}
}
@@ -174,19 +171,14 @@ macro_rules! hash_array_float {
if $multi_col {
for (hash, value) in $hashes.iter_mut().zip(values.iter()) {
*hash = combine_hashes(
- $ty::get_hash(
- &$ty::from_le_bytes(value.to_le_bytes()),
- $random_state,
- ),
+
$random_state.hash_one(&$ty::from_le_bytes(value.to_le_bytes())),
*hash,
);
}
} else {
for (hash, value) in $hashes.iter_mut().zip(values.iter()) {
- *hash = $ty::get_hash(
- &$ty::from_le_bytes(value.to_le_bytes()),
- $random_state,
- )
+ *hash =
+
$random_state.hash_one(&$ty::from_le_bytes(value.to_le_bytes()))
}
}
} else {
@@ -196,10 +188,8 @@ macro_rules! hash_array_float {
{
if !array.is_null(i) {
*hash = combine_hashes(
- $ty::get_hash(
- &$ty::from_le_bytes(value.to_le_bytes()),
- $random_state,
- ),
+ $random_state
+
.hash_one(&$ty::from_le_bytes(value.to_le_bytes())),
*hash,
);
}
@@ -209,10 +199,8 @@ macro_rules! hash_array_float {
$hashes.iter_mut().zip(values.iter()).enumerate()
{
if !array.is_null(i) {
- *hash = $ty::get_hash(
- &$ty::from_le_bytes(value.to_le_bytes()),
- $random_state,
- );
+ *hash = $random_state
+
.hash_one(&$ty::from_le_bytes(value.to_le_bytes()));
}
}
}
@@ -312,7 +300,7 @@ pub fn create_row_hashes<'a>(
*hash = 0
}
for (i, hash) in hashes_buffer.iter_mut().enumerate() {
- *hash = <Vec<u8>>::get_hash(&rows[i], random_state);
+ *hash = random_state.hash_one(&rows[i]);
}
Ok(hashes_buffer)
}
diff --git a/datafusion/expr/Cargo.toml b/datafusion/expr/Cargo.toml
index 2241e474b..6d368c63c 100644
--- a/datafusion/expr/Cargo.toml
+++ b/datafusion/expr/Cargo.toml
@@ -35,7 +35,7 @@ path = "src/lib.rs"
[features]
[dependencies]
-ahash = { version = "0.7", default-features = false }
+ahash = { version = "0.8", default-features = false, features =
["runtime-rng"] }
arrow = { version = "20.0.0", features = ["prettyprint"] }
datafusion-common = { path = "../common", version = "11.0.0" }
sqlparser = "0.20"
diff --git a/datafusion/physical-expr/Cargo.toml
b/datafusion/physical-expr/Cargo.toml
index 5cd65ca0a..b6ab3c5b2 100644
--- a/datafusion/physical-expr/Cargo.toml
+++ b/datafusion/physical-expr/Cargo.toml
@@ -39,7 +39,7 @@ regex_expressions = ["regex"]
unicode_expressions = ["unicode-segmentation"]
[dependencies]
-ahash = { version = "0.7", default-features = false }
+ahash = { version = "0.8", default-features = false, features =
["runtime-rng"] }
arrow = { version = "20.0.0", features = ["prettyprint"] }
blake2 = { version = "^0.10.2", optional = true }
blake3 = { version = "1.0", optional = true }
diff --git a/datafusion/sql/Cargo.toml b/datafusion/sql/Cargo.toml
index 5fbc5e9f2..6ad1da9e7 100644
--- a/datafusion/sql/Cargo.toml
+++ b/datafusion/sql/Cargo.toml
@@ -37,7 +37,7 @@ default = ["unicode_expressions"]
unicode_expressions = []
[dependencies]
-ahash = { version = "0.7", default-features = false }
+ahash = { version = "0.8", default-features = false, features =
["runtime-rng"] }
arrow = { version = "20.0.0", features = ["prettyprint"] }
datafusion-common = { path = "../common", version = "11.0.0" }
datafusion-expr = { path = "../expr", version = "11.0.0" }