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/03/27 05:44:08 UTC

[GitHub] [arrow-rs] viirya opened a new pull request #1490: Remove remove_indices

viirya opened a new pull request #1490:
URL: https://github.com/apache/arrow-rs/pull/1490


   # 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 #1482.
   
   # 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 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 `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] tustvold commented on a change in pull request #1490: Use Arrow take kernel within ListArrayReader

Posted by GitBox <gi...@apache.org>.
tustvold commented on a change in pull request #1490:
URL: https://github.com/apache/arrow-rs/pull/1490#discussion_r836215216



##########
File path: parquet/src/arrow/array_reader.rs
##########
@@ -929,20 +724,23 @@ impl<OffsetSize: OffsetSizeTrait> ArrayReader for ListArrayReader<OffsetSize> {
         // If a Parquet schema's only leaf is the list, then n = 0.
 
         // If the list index is at empty definition, the child slot is null
-        let null_list_indices: Vec<usize> = def_levels
+        let non_null_list_indices: Vec<u32> = def_levels
             .iter()
             .enumerate()
             .filter_map(|(index, def)| {
                 if *def <= self.list_empty_def_level {
-                    Some(index)
-                } else {
                     None
+                } else {
+                    Some(index as u32)
                 }
             })
             .collect();
-        let batch_values = match null_list_indices.len() {
-            0 => next_batch_array.clone(),
-            _ => remove_indices(next_batch_array.clone(), item_type, null_list_indices)?,
+        let batch_values = match non_null_list_indices.len() {
+            l if l == def_levels.len() => next_batch_array.clone(),
+            _ => {
+                let indices = UInt32Array::from(non_null_list_indices);

Review comment:
       You could remove the `collect` and then use `from_iter_values`, aside from being faster, this would also avoid unnecessary work in the no-nulls case.

##########
File path: parquet/src/arrow/array_reader.rs
##########
@@ -929,20 +724,23 @@ impl<OffsetSize: OffsetSizeTrait> ArrayReader for ListArrayReader<OffsetSize> {
         // If a Parquet schema's only leaf is the list, then n = 0.
 
         // If the list index is at empty definition, the child slot is null
-        let null_list_indices: Vec<usize> = def_levels
+        let non_null_list_indices: Vec<u32> = def_levels
             .iter()
             .enumerate()
             .filter_map(|(index, def)| {
                 if *def <= self.list_empty_def_level {
-                    Some(index)
-                } else {
                     None
+                } else {
+                    Some(index as u32)

Review comment:
       This could be more concisely written as `(*def > self.list_empty_def_level).then(|| index as u32)`




-- 
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 #1490: Remove remove_indices

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


   # [Codecov](https://codecov.io/gh/apache/arrow-rs/pull/1490?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 [#1490](https://codecov.io/gh/apache/arrow-rs/pull/1490?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b13bfa5) into [master](https://codecov.io/gh/apache/arrow-rs/commit/6bf3b3af5585c50026a314c26fdaf5b9b29d01e0?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (6bf3b3a) will **increase** coverage by `0.03%`.
   > The diff coverage is `85.71%`.
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #1490      +/-   ##
   ==========================================
   + Coverage   82.72%   82.76%   +0.03%     
   ==========================================
     Files         188      188              
     Lines       54286    54241      -45     
   ==========================================
   - Hits        44908    44891      -17     
   + Misses       9378     9350      -28     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/arrow-rs/pull/1490?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/array\_reader.rs](https://codecov.io/gh/apache/arrow-rs/pull/1490/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-cGFycXVldC9zcmMvYXJyb3cvYXJyYXlfcmVhZGVyLnJz) | `86.79% <85.71%> (+2.43%)` | :arrow_up: |
   | [arrow/src/compute/kernels/take.rs](https://codecov.io/gh/apache/arrow-rs/pull/1490/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-YXJyb3cvc3JjL2NvbXB1dGUva2VybmVscy90YWtlLnJz) | `95.41% <0.00%> (+0.13%)` | :arrow_up: |
   | [parquet\_derive/src/parquet\_field.rs](https://codecov.io/gh/apache/arrow-rs/pull/1490/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.22%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/arrow-rs/pull/1490?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/arrow-rs/pull/1490?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [6bf3b3a...b13bfa5](https://codecov.io/gh/apache/arrow-rs/pull/1490?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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] alamb commented on pull request #1490: Use Arrow take kernel within ListArrayReader

Posted by GitBox <gi...@apache.org>.
alamb commented on pull request #1490:
URL: https://github.com/apache/arrow-rs/pull/1490#issuecomment-1082260290


   Thank you @viirya  and @tustvold 


-- 
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] alamb merged pull request #1490: Use Arrow take kernel within ListArrayReader

Posted by GitBox <gi...@apache.org>.
alamb merged pull request #1490:
URL: https://github.com/apache/arrow-rs/pull/1490


   


-- 
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] viirya commented on pull request #1490: Use Arrow take kernel within ListArrayReader

Posted by GitBox <gi...@apache.org>.
viirya commented on pull request #1490:
URL: https://github.com/apache/arrow-rs/pull/1490#issuecomment-1082298195


   Thank you @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] viirya commented on pull request #1490: Use Arrow take kernel within ListArrayReader

Posted by GitBox <gi...@apache.org>.
viirya commented on pull request #1490:
URL: https://github.com/apache/arrow-rs/pull/1490#issuecomment-1082073185


   Thank you @tustvold 😄 


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