jorgecarleitao commented on issue #347:
URL: https://github.com/apache/arrow-rs/issues/347#issuecomment-850961026
I agree that it would be great to have a method to specify all capacities.
The required capacity is usually dependent on the problem over which
`MutableArrayData` is used for. Therefore, I suggest that the calculation of
which capacity to use to be made by the user of `MutableArrayData`, and not
inside `MutableArrayData` itself.
In this context, a way to address this is to allow something like
```rust
MutableArrayData::with_capacities(capacities: Capacities);
enum Capacities {
Binary(usize, Option<usize>), // Binary, Utf8
List(usize, Option<Box<Capacities>>),
...
}
```
and let `MutableArrayData` panic if the capacity variant is incompatible
with the arrays' `DataType`.
This gives users the freedom to pass other capacities.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]