rluvaton commented on code in PR #11524:
URL: https://github.com/apache/arrow-rs/pull/11524#discussion_r4371065421
##########
parquet/src/arrow/arrow_writer/byte_array.rs:
##########
@@ -301,53 +301,269 @@ impl FallbackEncoder {
}
}
-/// [`Storage`] for the [`Interner`] used by [`DictEncoder`]
+/// Maximum size of a value that can be inlined in the hash table
+const SHORT_VALUE_LEN: usize = size_of::<u64>() - 1;
+
+/// Entry in the hash table
+#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy)]
+struct Entry {
+ /// hash of the value (stored to avoid recomputing it in hash table check)
+ hash: u64,
+ /// if len =< [`SHORT_VALUE_LEN`]: the data inlined
+ /// if len > [`SHORT_VALUE_LEN`], the offset of where the data starts
+ offset_or_inline: OffsetOrInlineView,
+ /// value stored by the entry
Review Comment:
I see the confusion the value from hashmap point of view is the index to the
dictionary since this is like `HashMap<Vec<u8>, u64>`, but will remove the
comment to avoid confusion
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]