mbutrovich commented on code in PR #2349:
URL: https://github.com/apache/iceberg-rust/pull/2349#discussion_r3114301132
##########
crates/iceberg/src/arrow/reader.rs:
##########
@@ -242,34 +244,51 @@ pub struct ArrowReader {
parquet_read_options: ParquetReadOptions,
}
+/// Per-scan state for processing [`FileScanTask`]s. Created once per
+/// [`ArrowReader::read`] call and cloned per task.
+#[derive(Clone)]
+struct FileScanTaskReader {
+ batch_size: Option<usize>,
+ file_io: FileIO,
+ delete_file_loader: CachingDeleteFileLoader,
+ row_group_filtering_enabled: bool,
+ row_selection_enabled: bool,
+ parquet_read_options: ParquetReadOptions,
+ scan_metrics: ScanMetrics,
+}
+
impl ArrowReader {
/// Take a stream of FileScanTasks and reads all the files.
- /// Returns a stream of Arrow RecordBatches containing the data from the
files
+ /// Returns a stream of Arrow RecordBatches containing the data from the
files.
pub fn read(self, tasks: FileScanTaskStream) ->
Result<ArrowRecordBatchStream> {
- let file_io = self.file_io.clone();
- let batch_size = self.batch_size;
+ let (stream, _metrics) = self.read_with_metrics(tasks)?;
+ Ok(stream)
+ }
+
+ /// Same as [`read`](Self::read), but also returns [`ScanMetrics`] tracking
+ /// I/O during the scan.
+ pub fn read_with_metrics(
Review Comment:
I mostly wasn't sure about breaking the API. If we think it should always be
enabled (I think it should) then we can just update the existing API.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]