You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/07/20 20:03:56 UTC

[GitHub] [arrow-rs] thinkharderdev opened a new pull request, #2115: Add get_byte_ranges method to AsyncFileReader trait

thinkharderdev opened a new pull request, #2115:
URL: https://github.com/apache/arrow-rs/pull/2115

   # 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 #2110 
   
   # 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.
   -->
   
   In certain cases it is better from a performance perspective to fetch data in parallel such as reading from object storage. This adds a hook into the `AsyncFileReader` trait to allow upstream consumers of this API to do that. 
   
   # 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.
   -->
   
   Add `get_byte_ranges(&mut self, ranges: Vec<Range<usize>>)` method to `AsyncFileReader` trait with a default implementation that will fallback to calling `get_bytes` serially for the provided ranges. 
   
   # Are there any user-facing changes?
   
   No
   
   <!---
   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 `breaking 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-rs] thinkharderdev commented on pull request #2115: Add get_byte_ranges method to AsyncFileReader trait

Posted by GitBox <gi...@apache.org>.
thinkharderdev commented on PR #2115:
URL: https://github.com/apache/arrow-rs/pull/2115#issuecomment-1190702836

   @tustvold @alamb 


-- 
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-rs] codecov-commenter commented on pull request #2115: Add get_byte_ranges method to AsyncFileReader trait

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #2115:
URL: https://github.com/apache/arrow-rs/pull/2115#issuecomment-1190749078

   # [Codecov](https://codecov.io/gh/apache/arrow-rs/pull/2115?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#2115](https://codecov.io/gh/apache/arrow-rs/pull/2115?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (520f567) into [master](https://codecov.io/gh/apache/arrow-rs/commit/3096591520d303eb34a432c82733e86f34999232?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3096591) will **decrease** coverage by `0.02%`.
   > The diff coverage is `0.00%`.
   
   > :exclamation: Current head 520f567 differs from pull request most recent head a725223. Consider uploading reports for the commit a725223 to get more accurate results
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #2115      +/-   ##
   ==========================================
   - Coverage   83.76%   83.73%   -0.03%     
   ==========================================
     Files         225      225              
     Lines       59457    59477      +20     
   ==========================================
     Hits        49806    49806              
   - Misses       9651     9671      +20     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/arrow-rs/pull/2115?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [parquet/src/arrow/async\_reader.rs](https://codecov.io/gh/apache/arrow-rs/pull/2115/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGFycXVldC9zcmMvYXJyb3cvYXN5bmNfcmVhZGVyLnJz) | `0.00% <0.00%> (ø)` | |
   | [parquet\_derive/src/parquet\_field.rs](https://codecov.io/gh/apache/arrow-rs/pull/2115/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGFycXVldF9kZXJpdmUvc3JjL3BhcnF1ZXRfZmllbGQucnM=) | `65.98% <0.00%> (-0.23%)` | :arrow_down: |
   | [arrow/src/datatypes/datatype.rs](https://codecov.io/gh/apache/arrow-rs/pull/2115/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXJyb3cvc3JjL2RhdGF0eXBlcy9kYXRhdHlwZS5ycw==) | `64.41% <0.00%> (+0.35%)` | :arrow_up: |
   
   


-- 
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-rs] tustvold commented on a diff in pull request #2115: Add get_byte_ranges method to AsyncFileReader trait

Posted by GitBox <gi...@apache.org>.
tustvold commented on code in PR #2115:
URL: https://github.com/apache/arrow-rs/pull/2115#discussion_r926089131


##########
parquet/src/arrow/async_reader.rs:
##########
@@ -375,16 +404,27 @@ where
                                 let column = row_group_metadata.column(idx);
                                 let (start, length) = column.byte_range();
 
-                                let data = input
-                                    .get_bytes(start as usize..(start + length) as usize)
-                                    .await?;
+                                fetch_ranges
+                                    .push(start as usize..(start + length) as usize);
 
-                                *chunk = Some(InMemoryColumnChunk {
-                                    num_values: column.num_values(),
-                                    compression: column.compression(),
-                                    physical_type: column.column_type(),
-                                    data,
-                                });
+                                update_chunks.push((chunk, column));
+                            }
+
+                            for (idx, data) in input
+                                .get_byte_ranges(fetch_ranges)
+                                .await?
+                                .into_iter()
+                                .enumerate()

Review Comment:
   `.zip(update_chunks.iter_mut())` might be cleaner?



##########
parquet/src/arrow/async_reader.rs:
##########
@@ -366,6 +388,13 @@ where
                             let mut column_chunks =
                                 vec![None; row_group_metadata.columns().len()];
 
+                            let mut fetch_ranges =
+                                Vec::with_capacity(column_chunks.len());
+
+                            let mut update_chunks: Vec<(

Review Comment:
   My gut says that it would be cleaner to just iterate through the `column_chunks` and use `filter_map` to extract the ranges, pass this to `AsyncFileReader`. Convert the result to an iterator and then iterate the `column_chunks` again, popping the next element from the iterator for each included column.
   
   Not a big deal though



-- 
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-rs] tustvold merged pull request #2115: Add get_byte_ranges method to AsyncFileReader trait

Posted by GitBox <gi...@apache.org>.
tustvold merged PR #2115:
URL: https://github.com/apache/arrow-rs/pull/2115


-- 
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-rs] thinkharderdev commented on a diff in pull request #2115: Add get_byte_ranges method to AsyncFileReader trait

Posted by GitBox <gi...@apache.org>.
thinkharderdev commented on code in PR #2115:
URL: https://github.com/apache/arrow-rs/pull/2115#discussion_r926534284


##########
parquet/src/arrow/async_reader.rs:
##########
@@ -366,6 +388,13 @@ where
                             let mut column_chunks =
                                 vec![None; row_group_metadata.columns().len()];
 
+                            let mut fetch_ranges =
+                                Vec::with_capacity(column_chunks.len());
+
+                            let mut update_chunks: Vec<(

Review Comment:
   yeah, I think this was cleaner



-- 
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-rs] ursabot commented on pull request #2115: Add get_byte_ranges method to AsyncFileReader trait

Posted by GitBox <gi...@apache.org>.
ursabot commented on PR #2115:
URL: https://github.com/apache/arrow-rs/pull/2115#issuecomment-1191408420

   Benchmark runs are scheduled for baseline = 3096591520d303eb34a432c82733e86f34999232 and contender = be0d34d4fd37431ed57e7ab001da5f55a016a76e. be0d34d4fd37431ed57e7ab001da5f55a016a76e is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
   Conbench compare runs links:
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ec2-t3-xlarge-us-east-2] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/dcf5ab328623451b9a4b84e22911bd41...7072969fea4546e0bdfc02c6969890e7/)
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on test-mac-arm] [test-mac-arm](https://conbench.ursa.dev/compare/runs/bdd0cb8f39194eff94f9a5678e501254...ffccc75569be4f61b33a720e0efe34f7/)
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ursa-i9-9960x] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/da962e2a10d24696a76d148a5fc43b52...a0384f156986496983895530fbc0d66d/)
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ursa-thinkcentre-m75q] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/21d635797ed24a9d8308474630a2fcd2...8df77c8bd4ac4ec5ad8e4dfb815e32a0/)
   Buildkite builds:
   Supported benchmarks:
   ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
   test-mac-arm: Supported benchmark langs: C++, Python, R
   ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
   ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java
   


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