Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Parquet] Improve speed of dictionary encoding NaN float values #6953

Merged
merged 2 commits into from
Jan 11, 2025
Merged
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
5 changes: 3 additions & 2 deletions parquet/src/util/interner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const DEFAULT_DEDUP_CAPACITY: usize = 4096;
pub trait Storage {
type Key: Copy;

type Value: AsBytes + PartialEq + ?Sized;
type Value: AsBytes + ?Sized;

/// Gets an element by its key
fn get(&self, idx: Self::Key) -> &Self::Value;
Expand Down Expand Up @@ -66,7 +66,8 @@ impl<S: Storage> Interner<S> {
.dedup
.entry(
hash,
|index| value == self.storage.get(*index),
// Compare bytes rather than directly comparing values so NaNs can be interned
|index| value.as_bytes() == self.storage.get(*index).as_bytes(),
|key| self.state.hash_one(self.storage.get(*key).as_bytes()),
)
.or_insert_with(|| self.storage.push(value))
Expand Down
Loading