klion26 commented on code in PR #7935: URL: https://github.com/apache/arrow-rs/pull/7935#discussion_r2222164619
########## parquet-variant/src/builder.rs: ########## @@ -1275,38 +1330,80 @@ impl<'a> ObjectBuilder<'a> { ))); } - let data_size = self.buffer.offset(); - let num_fields = self.fields.len(); - let is_large = num_fields > u8::MAX as usize; + let metadata_builder = self.parent_state.metadata_builder(); self.fields.sort_by(|&field_a_id, _, &field_b_id, _| { - let key_a = &metadata_builder.field_name(field_a_id as usize); - let key_b = &metadata_builder.field_name(field_b_id as usize); - key_a.cmp(key_b) + let field_a_name = metadata_builder.field_name(field_a_id as usize); + let field_b_name = metadata_builder.field_name(field_b_id as usize); + field_a_name.cmp(field_b_name) }); - let max_id = self.fields.iter().map(|(i, _)| *i).max().unwrap_or(0); Review Comment: @scovich thanks for the reply, I've tried `let max_id = metadata_builder.field_names.len()` in commit(bdf1f2dda4693263d59c27d04439995b9c49138a), it will get a bigger header(the read/write logic is right), changed to `let max_id = metadata_builder.field_names.len() - 1` will get a bigger header size also, I'm figuring it now. -- 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