friendlymatthew opened a new pull request, #17076:
URL: https://github.com/apache/datafusion/pull/17076

   ## Rationale for this change
   
   This PR simplifies the design by making batch size a required parameter when 
calling `FileSource::create_file_opener`.
   
   When we go to open these files in `create_file_opener`, we do an `.expect()` 
call to ensure batch size is properly configured ahead of time. By passing in 
the batch size directly as a parameter, we can avoid the `.expect()` and avoid 
the `Option` altogether
   
   Instead of:
   ```rs
   let source = self
       .file_source
       .with_batch_size(batch_size) // sets `batch_size` to `Some(batch_size)`
       .with_projection(self);
   
   let opener = source.create_file_opener(object_store, self, partition); // 
inside here, we immediately do an .expect()
   ```
   
   We now directly pass the batch size
   ```rs
   let source = self
       .file_source
       .with_projection(self);
   
   let opener = source.create_file_opener(object_store, self, partition, 
batch_size);
   ```
   
   
   ## Are there any user-facing changes?
   
   Yes, the `FIleSource` trait is modified, as well as `DataSource` structs


-- 
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-unsubscr...@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to