Skip to content

Commit

Permalink
refactor: convert ArrowBytesViewMap to HashTable
Browse files Browse the repository at this point in the history
  • Loading branch information
crepererum committed Nov 21, 2024
1 parent 1bd8a36 commit e5dfc61
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions datafusion/physical-expr-common/src/binary_view_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use arrow::array::cast::AsArray;
use arrow::array::{Array, ArrayBuilder, ArrayRef, GenericByteViewBuilder};
use arrow::datatypes::{BinaryViewType, ByteViewType, DataType, StringViewType};
use datafusion_common::hash_utils::create_hashes;
use datafusion_common::utils::proxy::{RawTableAllocExt, VecAllocExt};
use datafusion_common::utils::proxy::{HashTableAllocExt, VecAllocExt};
use std::fmt::Debug;
use std::sync::Arc;

Expand Down Expand Up @@ -122,7 +122,7 @@ where
/// Should the output be StringView or BinaryView?
output_type: OutputType,
/// Underlying hash set for each distinct value
map: hashbrown::raw::RawTable<Entry<V>>,
map: hashbrown::hash_table::HashTable<Entry<V>>,
/// Total size of the map in bytes
map_size: usize,

Expand All @@ -148,7 +148,7 @@ where
pub fn new(output_type: OutputType) -> Self {
Self {
output_type,
map: hashbrown::raw::RawTable::with_capacity(INITIAL_MAP_CAPACITY),
map: hashbrown::hash_table::HashTable::with_capacity(INITIAL_MAP_CAPACITY),
map_size: 0,
builder: GenericByteViewBuilder::new(),
random_state: RandomState::new(),
Expand Down Expand Up @@ -274,7 +274,7 @@ where
// get the value as bytes
let value: &[u8] = value.as_ref();

let entry = self.map.get_mut(hash, |header| {
let entry = self.map.find_mut(hash, |header| {
let v = self.builder.get_value(header.view_idx);

if v.len() != value.len() {
Expand Down

0 comments on commit e5dfc61

Please sign in to comment.