-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
arrowChanges to the arrow crateChanges to the arrow crateenhancementAny new improvement worthy of a entry in the changelogAny new improvement worthy of a entry in the changeloggood first issueGood for newcomersGood for newcomers
Description
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
When creating a RecordBatchOptions object it would be nice to use a standard Rust patterns of either
A builder interface :
let options = RecordBatchOptions::new()
.with_rows_count(Some(row_count))Or Default::default() for pub structs:
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 error
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:
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 apache/datafusion#3439 (comment)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
arrowChanges to the arrow crateChanges to the arrow crateenhancementAny new improvement worthy of a entry in the changelogAny new improvement worthy of a entry in the changeloggood first issueGood for newcomersGood for newcomers