friendlymatthew commented on code in PR #7934:
URL: https://github.com/apache/arrow-rs/pull/7934#discussion_r2215851021


##########
parquet-variant/src/variant/object.rs:
##########
@@ -244,16 +252,22 @@ impl<'m, 'v> VariantObject<'m, 'v> {
                 // to check lexicographical order
                 //
                 // Since we are probing the metadata dictionary by field id, 
this also verifies field ids are in-bounds
-                let are_field_names_sorted = field_ids
-                    .iter()
-                    .map(|&i| self.metadata.get(i))
-                    .collect::<Result<Vec<_>, _>>()?
-                    .is_sorted();
-
-                if !are_field_names_sorted {
-                    return Err(ArrowError::InvalidArgumentError(
-                        "field names not sorted".to_string(),
-                    ));
+                let mut current_field_name = match field_ids_iter.next() {
+                    Some(field_id) => Some(self.metadata.get(field_id)?),
+                    None => None,
+                };
+
+                for field_id in field_ids_iter {
+                    let next_field_name = self.metadata.get(field_id)?;
+
+                    if let Some(current_name) = current_field_name {
+                        if next_field_name <= current_name {

Review Comment:
   Hi, I caught this post-merge but in this branch we can't assume the field 
names in the metadata dictionary are unique. So when we perform the probing 
mentioned in https://github.com/apache/arrow-rs/pull/7934/files#r2213356637, we 
should only check if `next_field_name` < `current_name`. 
   
   fixed in https://github.com/apache/arrow-rs/pull/7961
   



-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to