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

[GitHub] [arrow-datafusion] yahoNanJing opened a new pull request, #5790: Revert pr #5020

yahoNanJing opened a new pull request, #5790:
URL: https://github.com/apache/arrow-datafusion/pull/5790

   # Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   -->
   
   Closes #5788.
   
   # Rationale for this change
   
   <!--
    Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
    Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.  
   -->
   
   # What changes are included in this PR?
   
   <!--
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   # Are these changes tested?
   
   <!--
   We typically require tests for all PRs in order to:
   1. Prevent the code from being accidentally broken by subsequent changes
   2. Serve as another way to document the expected behavior of the code
   
   If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
   -->
   
   # Are there any user-facing changes?
   
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   <!--
   If there are any breaking changes to public APIs, please add the `api change` label.
   -->


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


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

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #5790:
URL: https://github.com/apache/arrow-datafusion/pull/5790#issuecomment-1499464262

   >  Thanks @alamb. My previous comment may be misleading. The main controversial is the metrics of time_elapsed_scanning_total contains the times cost by its parent operators, which may be misleading. By the above metrics, developers may think the bottleneck is the parquet scanning. However, it should be the aggregation whose time is wrongly counted in the metrics time_elapsed_scanning_total
   
   I think the parent/child relationships of where time is being spent will be hard to capture in scalar metrics (aka any sort of "elapsed time" metrics). I think to get that level of detail, DataFusion would likely need some sort of tracing / span abstraction that can show the heirarchy 


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


[GitHub] [arrow-datafusion] alamb closed pull request #5790: Revert pr #5020 (Parquet scan time metrics)

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb closed pull request #5790: Revert pr #5020 (Parquet scan time metrics)
URL: https://github.com/apache/arrow-datafusion/pull/5790


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


[GitHub] [arrow-datafusion] alamb commented on pull request #5790: Revert pr #5020

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #5790:
URL: https://github.com/apache/arrow-datafusion/pull/5790#issuecomment-1492496143

   For anyone else following along the original PR that added this change was https://github.com/apache/arrow-datafusion/pull/5020
   
   @yahoNanJing  -- looking at the screen shot you provided, 
   ![228734458-ddd80ca3-f59d-47a6-bd55-141ed31924e3](https://user-images.githubusercontent.com/490673/229212240-66994f1b-b811-4c6c-af9b-b0f8678c8fb2.png)
   
   It looks to me like the parquet file in question is being read using 2 streams (aka the file was opened by two different tasks which are reading it in parallel)
   
   Thus while the wall clock time takes only 4 seconds it may be possible that the total cpu time is actually 7 seconds
   
   You could potentially disable the `repartition_file_scans` option
   
   https://docs.rs/datafusion/latest/datafusion/config/struct.OptimizerOptions.html#structfield.repartition_file_scans
   
   And see if the metrics were more like what you expected
   
   Perhaps @thinkharderdev or @tustvold  have additional thoughts they could share
   


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


[GitHub] [arrow-datafusion] yahoNanJing commented on pull request #5790: Revert pr #5020

Posted by "yahoNanJing (via GitHub)" <gi...@apache.org>.
yahoNanJing commented on PR #5790:
URL: https://github.com/apache/arrow-datafusion/pull/5790#issuecomment-1489697395

   Hi @xiaoyong-z and @alamb, could you help have a check?


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


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

Posted by "thinkharderdev (via GitHub)" <gi...@apache.org>.
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


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

Posted by "yahoNanJing (via GitHub)" <gi...@apache.org>.
yahoNanJing commented on PR #5790:
URL: https://github.com/apache/arrow-datafusion/pull/5790#issuecomment-1493529835

   Thanks @alamb. My previous comment may be misleading. The main controversial is the metrics of **_time_elapsed_scanning_total_** contains the times cost by its parent operators, which may be misleading. By the above metrics, developers may think the bottleneck is the parquet scanning. However, it should be the aggregation whose time is wrongly counted in the metrics **_time_elapsed_scanning_total_**


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


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

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #5790:
URL: https://github.com/apache/arrow-datafusion/pull/5790#issuecomment-1503855712

   What is the final result of this PR? It seems like the consensus is that the metric is confusing, but potentially useful so we should keep it. If so, perhaps we can close this PR


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


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

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #5790:
URL: https://github.com/apache/arrow-datafusion/pull/5790#discussion_r1160132587


##########
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:
   Filed https://github.com/apache/arrow-datafusion/pull/5898



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


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

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #5790:
URL: https://github.com/apache/arrow-datafusion/pull/5790#discussion_r1160136403


##########
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:
   https://github.com/apache/arrow-datafusion/pull/5900



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


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

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #5790:
URL: https://github.com/apache/arrow-datafusion/pull/5790#issuecomment-1499461702

   Here is a proposed PR to update the metric descriptions to try and make them less confusing: https://github.com/apache/arrow-datafusion/pull/5898


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