EmilyMatt commented on code in PR #11524:
URL: https://github.com/apache/arrow-rs/pull/11524#discussion_r4371093219


##########
parquet/src/arrow/arrow_writer/byte_array.rs:
##########
@@ -301,53 +300,272 @@ 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,

Review Comment:
   This is also one of those cases where idiomatic Rust and perf might not be 
fully overlapping 😅 
   I think length can be u32, using OffsetOrInlineView forces both to u64?



-- 
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]

Reply via email to