We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 690dc35 commit c4d26dbCopy full SHA for c4d26db
parquet-variant/src/builder.rs
@@ -1204,7 +1204,11 @@ impl<'a> ObjectBuilder<'a> {
1204
let field_b_name = metadata_builder.field_name(field_b_id as usize);
1205
field_a_name.cmp(field_b_name)
1206
});
1207
- let max_id = self.fields.iter().map(|(i, _)| *i).max().unwrap_or(0);
+
1208
+ // the length of the metadata's field names is a very cheap to compute the upper bound.
1209
+ // it will almost always be a tight upper bound as well -- it would take a pretty
1210
+ // carefully crafted object to use only the early field ids of a large dictionary.
1211
+ let max_id = metadata_builder.field_names.len();
1212
let id_size = int_size(max_id as usize);
1213
1214
let parent_buffer = self.parent_state.buffer();
0 commit comments