Rich-T-kid commented on code in PR #11982:
URL: https://github.com/apache/arrow-rs/pull/11982#discussion_r4482187914
##########
parquet/src/arrow/arrow_writer/byte_array.rs:
##########
@@ -725,13 +819,26 @@ impl ColumnValueEncoder for ByteArrayEncoder {
}
fn write_gather(&mut self, values: &Self::Values, indices: &[usize]) ->
Result<()> {
- downcast_op!(
- values.data_type(),
- values,
- encode,
- indices.iter().copied(),
- self
- )
+ if let DataType::Dictionary(key, value) = values.data_type() {
+ let dictionary = values.as_any_dictionary().values();
+ if self
+ .dict_encoder
+ .as_ref()
+ .is_some_and(|encoder|
encoder.use_dictionary_cache(dictionary, values.len()))
Review Comment:
`use_dictionary_cache(dictionary, values.len())` counts null rows even
though only indices are encoded. A highly nullable array can therefore allocate
an 8 * dictionary.len() cache for very few or zero values, defeating the
profitability gate.
not sure what a good solution would be so for now I think it fine to keep it
and maybe create an issue to resolve it later
--
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]