sdf-jkl commented on PR #10636:
URL: https://github.com/apache/arrow-rs/pull/10636#issuecomment-5872924367
> i do wonder if we should be adding this to our public api 🤔
The new API:
```rust
let array = StructArrayBuilder::new()
.with_field("name", names, false)
.with_field("value", values, false)
.with_nulls(nulls)
.build()?;
```
is just syntactic sugar and lets us create `Field` inline vs:
```rust
let name_field = Arc::new(Field::new(
"name",
names.data_type().clone(),
false,
));
let value_field = Arc::new(Field::new(
"value",
values.data_type().clone(),
false,
));
let array = StructArray::from(vec![
(name_field, names),
(value_field, values),
]);
```
It's more functional/idiomatic and would be nice to have.
> it is simple enough, but could be slightly confusing as it doesnt follow
our other builder patterns
I suggest using a different name to disambiguate it --
`StructArrayAssembler` :shrug:
--
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]