You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "thinkharderdev (via GitHub)" <gi...@apache.org> on 2023/04/03 10:04:43 UTC

[GitHub] [arrow-datafusion] thinkharderdev commented on a diff in pull request #5790: Revert pr #5020 (Parquet scan time metrics)

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

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