isidentical commented on code in PR #3439:
URL: https://github.com/apache/arrow-datafusion/pull/3439#discussion_r968556985
##########
datafusion/core/src/physical_plan/coalesce_batches.rs:
##########
@@ -291,7 +291,11 @@ pub fn concat_batches(
batches.len(),
row_count
);
- RecordBatch::try_new(schema.clone(), arrays)
+
+ let mut options = RecordBatchOptions::default();
+ options.row_count = Some(row_count);
Review Comment:
This seems to fail since `RecordBatchOptions` is non-exhaustive and comes
directly from arrow-rs. I am not really familiar with this part of Rust
semantics, but there seems to be an [existing
issue](https://internals.rust-lang.org/t/allow-constructing-non-exhaustive-structs-using-default-default/13868)
about 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`.
```
Is there any way to achieve it? The only other example of
`RecordBatchOptions` construction present in DF is the following which uses the
same pattern as the code present in this PR but I'd be happy to refactor both
if there is a more idiomatic way.
https://github.com/apache/arrow-datafusion/blob/9956f80f197550051db7debae15d5c706afc22a3/datafusion/core/src/physical_plan/file_format/mod.rs#L286-L288
--
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]