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


##########
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() {

Review Comment:
   Hi, this is how I understood the spec
   
   > The field ids and field offsets must be in lexicographical order of the 
corresponding field names in the metadata dictionary
   
   If we have an object with a sorted dictionary, the field ids are already 
ordered by the lexicographical order of field names.
   
   If we don't have a sorted dictionary, we iterate through the field ids and 
probe the object for the corresponding field name. If the field names are 
lexicographically ordered, we can also verify that the field ids are in 
lexicographical order. 
   
   



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