thinkharderdev commented on code in PR #5790:
URL: https://github.com/apache/arrow-datafusion/pull/5790#discussion_r1155734134
##########
datafusion/core/src/physical_plan/file_format/file_stream.rs:
##########
@@ -232,23 +223,20 @@ impl<F: FileOpener> FileStream<F> {
fn poll_inner(&mut self, cx: &mut Context<'_>) ->
Poll<Option<Result<RecordBatch>>> {
loop {
match &mut self.state {
- FileStreamState::Idle => {
- self.file_stream_metrics.time_opening.start();
-
- match self.start_next_file().transpose() {
- Ok(Some((future, partition_values))) => {
- self.state = FileStreamState::Open {
- future,
- partition_values,
- }
- }
- Ok(None) => return Poll::Ready(None),
- Err(e) => {
- self.state = FileStreamState::Error;
- return Poll::Ready(Some(Err(e)));
+ FileStreamState::Idle => match
self.start_next_file().transpose() {
+ Ok(Some((future, partition_values))) => {
+ self.file_stream_metrics.time_opening.start();
Review Comment:
I think we want this call before `self.start_next_file`. In some cases (for
example, when reading from the `LocalFileSystem` store outside of a Tokio
context) this can block and we would not capture the time spent on disk IO.
--
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]