This is an automated email from the ASF dual-hosted git repository.
dheres pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git
The following commit(s) were added to refs/heads/main by this push:
new 846befb6a6 minor: Remove unused create_row_hashes (#12083)
846befb6a6 is described below
commit 846befb6a620d3b8c0c7ff01be7c35c45fb72360
Author: Andy Grove <[email protected]>
AuthorDate: Tue Aug 20 19:53:11 2024 -0600
minor: Remove unused create_row_hashes (#12083)
* remove redundant loop
* remove redundant loop
* remove unused methods
---
datafusion/common/src/hash_utils.rs | 65 -------------------------------------
1 file changed, 65 deletions(-)
diff --git a/datafusion/common/src/hash_utils.rs
b/datafusion/common/src/hash_utils.rs
index f57ec0152e..f3d2a0a4f9 100644
--- a/datafusion/common/src/hash_utils.rs
+++ b/datafusion/common/src/hash_utils.rs
@@ -23,7 +23,6 @@ use std::sync::Arc;
use ahash::RandomState;
use arrow::array::*;
use arrow::datatypes::*;
-use arrow::row::Rows;
#[cfg(not(feature = "force_hash_collisions"))]
use arrow::{downcast_dictionary_array, downcast_primitive_array};
use arrow_buffer::IntervalDayTime;
@@ -363,38 +362,6 @@ pub fn create_hashes<'a>(
Ok(hashes_buffer)
}
-/// Test version of `create_row_hashes` that produces the same value for
-/// all hashes (to test collisions)
-///
-/// See comments on `hashes_buffer` for more details
-#[cfg(feature = "force_hash_collisions")]
-pub fn create_row_hashes<'a>(
- _rows: &[Vec<u8>],
- _random_state: &RandomState,
- hashes_buffer: &'a mut Vec<u64>,
-) -> Result<&'a mut Vec<u64>> {
- for hash in hashes_buffer.iter_mut() {
- *hash = 0
- }
- Ok(hashes_buffer)
-}
-
-/// Creates hash values for every row, based on their raw bytes.
-#[cfg(not(feature = "force_hash_collisions"))]
-pub fn create_row_hashes<'a>(
- rows: &[Vec<u8>],
- random_state: &RandomState,
- hashes_buffer: &'a mut Vec<u64>,
-) -> Result<&'a mut Vec<u64>> {
- for hash in hashes_buffer.iter_mut() {
- *hash = 0
- }
- for (i, hash) in hashes_buffer.iter_mut().enumerate() {
- *hash = random_state.hash_one(&rows[i]);
- }
- Ok(hashes_buffer)
-}
-
/// Creates hash values for every row, based on the values in the
/// columns.
///
@@ -468,38 +435,6 @@ pub fn create_hashes<'a>(
Ok(hashes_buffer)
}
-/// Test version of `create_row_hashes_v2` that produces the same value for
-/// all hashes (to test collisions)
-///
-/// See comments on `hashes_buffer` for more details
-#[cfg(feature = "force_hash_collisions")]
-pub fn create_row_hashes_v2<'a>(
- _rows: &Rows,
- _random_state: &RandomState,
- hashes_buffer: &'a mut Vec<u64>,
-) -> Result<&'a mut Vec<u64>> {
- for hash in hashes_buffer.iter_mut() {
- *hash = 0
- }
- Ok(hashes_buffer)
-}
-
-/// Creates hash values for every row, based on their raw bytes.
-#[cfg(not(feature = "force_hash_collisions"))]
-pub fn create_row_hashes_v2<'a>(
- rows: &Rows,
- random_state: &RandomState,
- hashes_buffer: &'a mut Vec<u64>,
-) -> Result<&'a mut Vec<u64>> {
- for hash in hashes_buffer.iter_mut() {
- *hash = 0
- }
- for (i, hash) in hashes_buffer.iter_mut().enumerate() {
- *hash = random_state.hash_one(rows.row(i));
- }
- Ok(hashes_buffer)
-}
-
#[cfg(test)]
mod tests {
use std::sync::Arc;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]