adriangb commented on code in PR #6319:
URL: https://github.com/apache/arrow-rs/pull/6319#discussion_r1735105320


##########
parquet/src/file/page_index/index.rs:
##########
@@ -227,19 +227,16 @@ impl<T: ParquetValueType> NativeIndex<T> {
     }
 
     pub(crate) fn to_thrift(&self) -> ColumnIndex {
-        let min_values = self
-            .indexes
-            .iter()
-            .map(|x| x.min_bytes().map(|x| x.to_vec()))
-            .collect::<Option<Vec<_>>>()
-            .unwrap_or_else(|| vec![vec![]; self.indexes.len()]);
-
-        let max_values = self
-            .indexes
-            .iter()
-            .map(|x| x.max_bytes().map(|x| x.to_vec()))
-            .collect::<Option<Vec<_>>>()
-            .unwrap_or_else(|| vec![vec![]; self.indexes.len()]);
+        let mut min_values = vec![vec![]; self.indexes.len()];
+        let mut max_values = vec![vec![]; self.indexes.len()];
+        for (i, index) in self.indexes.iter().enumerate() {
+            if let Some(min) = index.min_bytes() {
+                min_values[i].extend_from_slice(min);
+            }
+            if let Some(max) = index.max_bytes() {
+                max_values[i].extend_from_slice(max);
+            }
+        }

Review Comment:
   yup i think it would be, changed



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