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/06/07 20:42:10 UTC

[GitHub] [arrow-rs] viirya opened a new pull request, #1818: Fix list equal for empty offset list array

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

   # 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 #1817.
   
   # 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] viirya merged pull request #1818: Fix list equal for empty offset list array

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


-- 
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] HaoYang670 commented on pull request #1818: Fix list equal for empty offset list array

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

   I guess this PR is related to #1620.


-- 
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 #1818: Fix list equal for empty offset list array

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

   # [Codecov](https://codecov.io/gh/apache/arrow-rs/pull/1818?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 [#1818](https://codecov.io/gh/apache/arrow-rs/pull/1818?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (fbead0d) into [master](https://codecov.io/gh/apache/arrow-rs/commit/b5fbd119a53dfd90d370fd119f463ad196a3df5b?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b5fbd11) will **decrease** coverage by `0.01%`.
   > The diff coverage is `100.00%`.
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #1818      +/-   ##
   ==========================================
   - Coverage   83.46%   83.45%   -0.02%     
   ==========================================
     Files         199      199              
     Lines       56600    56673      +73     
   ==========================================
   + Hits        47244    47294      +50     
   - Misses       9356     9379      +23     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/arrow-rs/pull/1818?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [arrow/src/array/equal/list.rs](https://codecov.io/gh/apache/arrow-rs/pull/1818/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-YXJyb3cvc3JjL2FycmF5L2VxdWFsL2xpc3QucnM=) | `96.47% <100.00%> (+0.08%)` | :arrow_up: |
   | [arrow/src/array/equal/mod.rs](https://codecov.io/gh/apache/arrow-rs/pull/1818/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-YXJyb3cvc3JjL2FycmF5L2VxdWFsL21vZC5ycw==) | `96.20% <100.00%> (+0.10%)` | :arrow_up: |
   | [parquet/src/util/memory.rs](https://codecov.io/gh/apache/arrow-rs/pull/1818/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-cGFycXVldC9zcmMvdXRpbC9tZW1vcnkucnM=) | `87.17% <0.00%> (-2.30%)` | :arrow_down: |
   | [arrow/src/datatypes/native.rs](https://codecov.io/gh/apache/arrow-rs/pull/1818/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-YXJyb3cvc3JjL2RhdGF0eXBlcy9uYXRpdmUucnM=) | `66.66% <0.00%> (ø)` | |
   | [parquet/src/arrow/async\_reader.rs](https://codecov.io/gh/apache/arrow-rs/pull/1818/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%> (ø)` | |
   | [arrow/src/array/data.rs](https://codecov.io/gh/apache/arrow-rs/pull/1818/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-YXJyb3cvc3JjL2FycmF5L2RhdGEucnM=) | `84.16% <0.00%> (+0.18%)` | :arrow_up: |
   | [arrow/src/datatypes/datatype.rs](https://codecov.io/gh/apache/arrow-rs/pull/1818/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==) | `65.79% <0.00%> (+0.37%)` | :arrow_up: |
   | [parquet/src/compression.rs](https://codecov.io/gh/apache/arrow-rs/pull/1818/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-cGFycXVldC9zcmMvY29tcHJlc3Npb24ucnM=) | `89.68% <0.00%> (+1.08%)` | :arrow_up: |
   | [parquet/src/file/footer.rs](https://codecov.io/gh/apache/arrow-rs/pull/1818/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-cGFycXVldC9zcmMvZmlsZS9mb290ZXIucnM=) | `98.11% <0.00%> (+2.74%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/arrow-rs/pull/1818?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/1818?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 [b5fbd11...fbead0d](https://codecov.io/gh/apache/arrow-rs/pull/1818?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] HaoYang670 commented on a diff in pull request #1818: Fix list equal for empty offset list array

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


##########
arrow/src/array/equal/list.rs:
##########
@@ -73,11 +73,19 @@ pub(super) fn list_equal<T: OffsetSizeTrait>(
     // however, one is more likely to slice into a list array and get a region that has 0
     // child values.
     // The test that triggered this behaviour had [4, 4] as a slice of 1 value slot.
-    let lhs_child_length = lhs_offsets[lhs_start + len].to_usize().unwrap()
-        - lhs_offsets[lhs_start].to_usize().unwrap();
+    let lhs_child_length = if len == 0 {

Review Comment:
   What about just add 
   ```rust
   // Zero length list arrays are always equal
   if len == 0 {
       return true;
   }
   ```
   at the beginning of the function?
   
   `lhs_child_length` is the length of the child array. For am empty list array, this length is undefined. 



-- 
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 #1818: Fix list equal for empty offset list array

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

   Thanks @tustvold @HaoYang670 


-- 
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] HaoYang670 commented on a diff in pull request #1818: Fix list equal for empty offset list array

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


##########
arrow/src/array/equal/list.rs:
##########
@@ -73,11 +73,19 @@ pub(super) fn list_equal<T: OffsetSizeTrait>(
     // however, one is more likely to slice into a list array and get a region that has 0
     // child values.
     // The test that triggered this behaviour had [4, 4] as a slice of 1 value slot.

Review Comment:
   nit: We should also update the docs. Because we add an edge case for zero-length array



##########
arrow/src/array/equal/mod.rs:
##########
@@ -629,6 +629,39 @@ mod tests {
         test_equal(&a, &b, false);
     }
 
+    #[test]

Review Comment:
   Should we also test that 2 zero-length arrays with different (offset, null-buffer, childdata) are equal?



##########
arrow/src/array/equal/list.rs:
##########
@@ -73,11 +73,19 @@ pub(super) fn list_equal<T: OffsetSizeTrait>(
     // however, one is more likely to slice into a list array and get a region that has 0
     // child values.
     // The test that triggered this behaviour had [4, 4] as a slice of 1 value slot.
-    let lhs_child_length = lhs_offsets[lhs_start + len].to_usize().unwrap()
-        - lhs_offsets[lhs_start].to_usize().unwrap();
+    let lhs_child_length = if len == 0 {

Review Comment:
   What about just add 
   ```rust
   // Zero length list arrays are always equal
   if len == 0 {
       return true;
   }
   ```
   at the beginning of the function?



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