You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/09/14 19:08:05 UTC

[GitHub] [arrow-rs] alamb opened a new issue, #2728: Make constructing RecordBatchOptions more ergonomic

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: github-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] alamb commented on issue #2728: API for more ergonomic construction of `RecordBatchOptions`

Posted by GitBox <gi...@apache.org>.
alamb commented on issue #2728:
URL: https://github.com/apache/arrow-rs/issues/2728#issuecomment-1247191529

   I think this is a good first issue because the API is relatively new, adding a builder interface is backwards compatible, and this would be a good way to learn the codebase and process in arrow


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] tustvold closed issue #2728: API for more ergonomic construction of `RecordBatchOptions`

Posted by GitBox <gi...@apache.org>.
tustvold closed issue #2728: API for more ergonomic construction of `RecordBatchOptions`
URL: https://github.com/apache/arrow-rs/issues/2728


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] askoa commented on issue #2728: API for more ergonomic construction of `RecordBatchOptions`

Posted by GitBox <gi...@apache.org>.
askoa commented on issue #2728:
URL: https://github.com/apache/arrow-rs/issues/2728#issuecomment-1247316193

   `let options = RecordBatchOptions{
         row_count:Some(row_count),
         ..Default::default()
       };`
   
   I don't think the above option is possible due to non-exhaustive clause. There is already default implemented for this struct and not working.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] askoa commented on issue #2728: API for more ergonomic construction of `RecordBatchOptions`

Posted by GitBox <gi...@apache.org>.
askoa commented on issue #2728:
URL: https://github.com/apache/arrow-rs/issues/2728#issuecomment-1247297651

   I'll pick this one!


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org