Add bytes scanned metric to ParquetExec#2273
Merged
andygrove merged 1 commit intoapache:masterfrom Apr 21, 2022
Merged
Conversation
andygrove
reviewed
Apr 20, 2022
| fn get_read(&self, start: u64, length: usize) -> ParquetResult<Self::T> { | ||
| self.0 | ||
| if let Some(m) = self.bytes_scanned.as_ref() { | ||
| m.add(length) |
Member
There was a problem hiding this comment.
I'm just curious .. the length here is the number of bytes requested and could potentially be different from the actual number of bytes read?
Contributor
Author
There was a problem hiding this comment.
I don't think this interface actually specifies so it would really be up to the specific ObjectStore implementation. I know that that is the way the LocalFileSystem works and I believe that is the way the AWS S3 API works with file ranges.
andygrove
approved these changes
Apr 20, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes #.
Rationale for this change
Tracking total number of bytes read from storage is an important metric for query execution (especially for use cases where data is read from object storage or NAS rather than a local SSD). It's especially important for Parquet data sources where we have many levers we can pull to reduce the amount of data read.
What changes are included in this PR?
Add a
bytes_scannedcounter toParquetFileMetricsand track total number of bytes read throughChunkObjectReader. This should be quite cheap since we pass the number of bytes to read as an argument.Are there any user-facing changes?
ParquetExecwill have abytes_scannedmetric.No