mapleFU commented on code in PR #4389:
URL: https://github.com/apache/arrow-rs/pull/4389#discussion_r1223895019


##########
parquet/src/column/writer/mod.rs:
##########
@@ -683,6 +683,14 @@ impl<'a, E: ColumnValueEncoder> GenericColumnWriter<'a, E> 
{
             .append_row_count(self.page_metrics.num_buffered_rows as i64);
     }
 
+    fn truncate_minmax_value(&self, data: &[u8]) -> Vec<u8> {
+        if let Some(max_len) = self.props.minmax_value_truncate_len() {
+            data[0..usize::min(data.len(), max_len)].to_vec()

Review Comment:
   ```java
       @Override
       Binary truncateMax(Binary maxValue, int length) {
         if (maxValue.length() <= length) {
           return maxValue;
         }
         byte[] array;
         ByteBuffer buffer = maxValue.toByteBuffer();
         if (validator.checkValidity(buffer) == Validity.VALID) {
           array = incrementUtf8(truncateUtf8(buffer, length));
         } else {
           array = increment(truncate(buffer, length));
         }
         return array == null ? maxValue : Binary.fromConstantByteArray(array);
       }
   ```
   
   Seems that in parquet-mr, `truncateMax` does a `increment` here.



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