alamb opened a new issue, #2728:
URL: https://github.com/apache/arrow-rs/issues/2728
**Is your feature request related to a problem or challenge? Please describe
what you are trying to do.**
When creating a `RecordBatchOption`s object it would be nice to use a
standard Rust pattern of either a builder :
```rust
let options = RecordBatchOptions::new()
.with_rows_count(Some(row_count))
```
Or `Default::default()` for `pub` structs:
```rust
let options = RecordBatchOptions{
row_count:Some(row_count),
..Default::default()
};
```
However, there is no builder interface provided and `RecordBatchOptions` is
marked as non-exhaustive so you get this when trying to use it
```
error[E0639]: cannot create non-exhaustive struct using struct expression
-->
/home/isidentical/projects/arrow-datafusion/datafusion/core/src/physical_plan/coalesce_batches.rs:295:19
|
295 | let options = RecordBatchOptions {
| ___________________^
296 | | row_count: Some(row_count),
297 | | ..Default::default()
298 | | };
| |_____^
For more information about this error, try `rustc --explain E0639`.
```
This means you have to use `mut` like:
```rust
let mut options = RecordBatchOptions::default();
options.row_count = Some(row_count);
```
**Describe the solution you'd like**
Add a builder interface for RecordBatchOptions
**Additional context**
See comments from @isidentical
https://github.com/apache/arrow-datafusion/pull/3439#discussion_r968556985
--
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]