avantgardnerio commented on issue #479:
URL: https://github.com/apache/arrow-ballista/issues/479#issuecomment-1325232522

   FWIW, I'd love to switch to a more `Default` & [struct update 
syntax](https://stackoverflow.com/questions/48389072/what-is-the-syntax-inside-a-struct-literal-in-rust)
 format for configs. Here's an example in practice of building very complex 
structs for the SQL parser, but only overriding certain fields that the user 
cares about:
   
   ```
                       let query = ast::Query {
                           body: Box::new(SetExpr::Select(Box::new(ast::Select {
                               projection,
                               from: vec![table],
                               selection,
                               ..default_select()
                           }))),
                           ..default_query()
                       };
   ```
   
   IMO this more concisely solves the problem without the multiple state 
mutations of the builder pattern, which seems closer to idiomatic Rust.
   
   CC @alamb because he's talked about this in datafusion.


-- 
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]

Reply via email to