EmilyMatt commented on code in PR #11982:
URL: https://github.com/apache/arrow-rs/pull/11982#discussion_r4435492688
##########
parquet/src/arrow/arrow_writer/byte_array.rs:
##########
@@ -598,13 +631,74 @@ impl DictEncoder {
Ok(())
}
+ /// Whether to encode the rows of an arrow dictionary with `dictionary` as
its values and
+ /// `num_rows` rows with [`Self::encode_dictionary`]
+ fn use_dictionary_cache(&self, dictionary: &ArrayRef, num_rows: usize) ->
bool {
+ // A new cache has a slot per dictionary value, which only pays off if
the values are
+ // referenced by enough rows
+ dictionary.len() <= num_rows
+ || self
+ .dictionary_cache
+ .as_ref()
+ .is_some_and(|cache| cache.is_for(dictionary))
+ }
+
+ /// Encode the rows of an arrow dictionary at `indices` to the in-progress
page
+ fn encode_dictionary<'a, K, V>(
Review Comment:
not attached to it, will do
--
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]