klion26 commented on code in PR #10635:
URL: https://github.com/apache/arrow-rs/pull/10635#discussion_r3869374415
##########
parquet-variant-compute/src/shred_variant.rs:
##########
@@ -2898,6 +2911,49 @@ mod tests {
Ok(())
}
+ #[test]
+ fn test_variant_schema_builder_list() -> Result<()> {
+ let shredding_type = ShreddedSchemaBuilder::default()
+ .with_path("items[0].id", &DataType::Int64)?
+ .with_path("items[42].name", &DataType::Utf8)?
Review Comment:
Using `['*']` is better than [0] here from my side because the `variant_get`
will receive the `variantpath` and [0] means the first item in the array, and
using [0] to indicate the whole array here may be confusing.
Does adding an interface for `ShreddedSchemaBuilder` to support list type
solve this(like `VariantBuilder::new_list()`)? But this seems can't handle the
case where `with_path(.., ..)` receives a `VariantPath` for the first argument
very well(there may be `[]` in the VariantPath), and not sure if it will be too
complicated for such a case here.
--
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]