Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/common/hashtable/src/hashjoin_hashtable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@ impl<K: Keyable, A: Allocator + Clone + Default + 'static, const SKIP_DUPLICATES
atomic_pointers: std::ptr::null_mut(),
hash_shift: (hash_bits() - capacity.trailing_zeros()) as usize,
phantom: PhantomData,
count: Default::default(),
count: match SKIP_DUPLICATES {
true => Default::default(),
false => AtomicUsize::new(row_num),
},
};
hashtable.atomic_pointers = unsafe {
std::mem::transmute::<*mut u64, *mut AtomicU64>(hashtable.pointers.as_mut_ptr())
Expand Down Expand Up @@ -172,7 +175,11 @@ impl<K: Keyable, A: Allocator + Clone + Default + 'static, const SKIP_DUPLICATES
Err(x) => old_header = x,
};
}
self.count.fetch_add(1, Ordering::Relaxed);

if SKIP_DUPLICATES {
self.count.fetch_add(1, Ordering::Relaxed);
}

unsafe { (*entry_ptr).next = remove_header_tag(old_header) };
}
}
Expand Down
11 changes: 9 additions & 2 deletions src/common/hashtable/src/hashjoin_string_hashtable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ impl<A: Allocator + Clone + Default + 'static, const SKIP_DUPLICATES: bool>
},
atomic_pointers: std::ptr::null_mut(),
hash_shift: (hash_bits() - capacity.trailing_zeros()) as usize,
count: Default::default(),
count: match SKIP_DUPLICATES {
true => Default::default(),
false => AtomicUsize::new(row_num),
},
};
hashtable.atomic_pointers = unsafe {
std::mem::transmute::<*mut u64, *mut AtomicU64>(hashtable.pointers.as_mut_ptr())
Expand Down Expand Up @@ -105,7 +108,11 @@ impl<A: Allocator + Clone + Default + 'static, const SKIP_DUPLICATES: bool>
Err(x) => old_header = x,
};
}
self.count.fetch_add(1, Ordering::Relaxed);

if SKIP_DUPLICATES {
self.count.fetch_add(1, Ordering::Relaxed);
}

unsafe { (*entry_ptr).next = remove_header_tag(old_header) };
}
}
Expand Down