sdf-jkl commented on code in PR #11351:
URL: https://github.com/apache/arrow-rs/pull/11351#discussion_r4285251122
##########
parquet-variant-compute/src/shred_variant.rs:
##########
@@ -423,16 +423,23 @@ impl<'a> VariantToShreddedObjectVariantRowBuilder<'a> {
} = self;
seen.fill(false);
let mut builder = value_builder.builder_ext(value.metadata());
- let mut object_builder = builder.try_new_object()?;
+ // Error on a repeated unshredded field instead of overwriting it
+ let mut object_builder =
builder.try_new_object()?.with_validate_unique_fields(true);
Review Comment:
Small pre-existing documentation nit:
the docs for
[`ObjectBuilder::with_validate_unique_fields`](https://github.com/apache/arrow-rs/blob/a3310ab1141d9d7f1744ad82c6b5273cde8d769c/parquet-variant/src/builder/object.rs#L186-L189)
and
[`VariantBuilder::with_validate_unique_fields`](https://github.com/apache/arrow-rs/blob/a3310ab1141d9d7f1744ad82c6b5273cde8d769c/parquet-variant/src/builder.rs#L769-L773)
still say duplicates cause `ObjectBuilder::finish()` to return an error.
The check actually happens during insertion, and `finish()` returns `()`.
--
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]