sdf-jkl commented on code in PR #10124:
URL: https://github.com/apache/arrow-rs/pull/10124#discussion_r3398583141
##########
parquet-variant-compute/src/variant_array.rs:
##########
@@ -420,19 +420,36 @@ impl VariantArray {
}
}
- /// Return a reference to the metadata field of the [`StructArray`]
- pub fn metadata_field(&self) -> &ArrayRef {
+ /// Return a reference to the `metadata` column of the [`StructArray`]
+ pub fn metadata_column(&self) -> &ArrayRef {
&self.metadata
}
- /// Return a reference to the value field of the `StructArray`
- pub fn value_field(&self) -> Option<&ArrayRef> {
- self.shredding_state.value_field()
+ /// Return a reference to the `value` column of the [`StructArray`], if
present
+ pub fn value_column(&self) -> Option<&ArrayRef> {
+ self.shredding_state.value_column()
}
- /// Return a reference to the typed_value field of the `StructArray`, if
present
- pub fn typed_value_field(&self) -> Option<&ArrayRef> {
- self.shredding_state.typed_value_field()
+ /// Return a reference to the `typed_value` column of the [`StructArray`],
if present
+ pub fn typed_value_column(&self) -> Option<&ArrayRef> {
+ self.shredding_state.typed_value_column()
+ }
+
+ /// Return the [`FieldRef`] of the `metadata` column of the [`StructArray`]
Review Comment:
Now that I look at it the new `_field` APIs would only be used for tests in
#10015.
```rust
// before reuse StructArray::field_by_name (#10110), returns
Option<&FieldRef>
let typed_value_field =
variant_array.inner().field_by_name("typed_value").unwrap();
// new — the new VariantArray sugar, returns Option<&FieldRef> (no
.inner(), no magic string)
let typed_value_field = variant_array.typed_value_field().unwrap();
```
Is it worth introducing for 4 calls in tests?
--
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]