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/01/25 07:41:05 UTC

[GitHub] [arrow-rs] HaoYang670 opened a new pull request #1238: dyn compare for binary array

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


   # 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 #1108 
   
   # 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.
   -->
   1. Update the API of `typed_compare`, so that it supports compare 2 binary arrays
   2. Add dynamic dispatched functions to compare a binary array and a scalar
   3. Add tests for functions `*_dyn_binary_scalar`.
   4. `DictionaryArray` with binary values is not supported so far, because I could not find an easy way to build a binary dictionary array. Is there any builder such as `StringDictionaryBuilder` can be used for binary type?
   # 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 #1238: dyn compare for binary array

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



##########
File path: arrow/src/compute/kernels/comparison.rs
##########
@@ -3843,6 +3960,114 @@ mod tests {
         assert_eq!(neq_dyn_scalar(&array, 8).unwrap(), expected);
     }
 
+    #[test]
+    fn test_eq_dyn_binary_scalar() {
+        let array = BinaryArray::from_vec(
+            vec![b"arrow", b"datafusion", b"flight", b"parquet", &[0xff, 0xf8]],
+        );
+        let large_array = LargeBinaryArray::from_vec(
+            vec![b"arrow", b"datafusion", b"flight", b"parquet", &[0xff, 0xf8]],
+        );
+        let scalar = "flight".as_bytes();
+        let expected = BooleanArray::from(vec![false, false, true, false, false]);
+
+        assert_eq!(eq_dyn_binary_scalar(&array, scalar).unwrap(), expected);
+        assert_eq!(
+            eq_dyn_binary_scalar(&large_array, scalar).unwrap(),
+            expected
+        );
+    }
+
+    #[test]
+    fn test_neq_dyn_binary_scalar() {
+        let array = BinaryArray::from_vec(
+            vec![b"arrow", b"datafusion", b"flight", b"parquet", &[0xff, 0xf8]],
+        );
+        let large_array = LargeBinaryArray::from_vec(
+            vec![b"arrow", b"datafusion", b"flight", b"parquet", &[0xff, 0xf8]],
+        );
+        let scalar = "flight".as_bytes();
+        let expected = BooleanArray::from(vec![true, true, false, true, true]);
+
+        assert_eq!(neq_dyn_binary_scalar(&array, scalar).unwrap(), expected);
+        assert_eq!(
+            neq_dyn_binary_scalar(&large_array, scalar).unwrap(),
+            expected
+        );
+    }
+
+    #[test]
+    fn test_lt_dyn_binary_scalar() {
+        let array = BinaryArray::from_vec(
+            vec![b"arrow", b"datafusion", b"flight", b"parquet", &[0xff, 0xf8]],
+        );
+        let large_array = LargeBinaryArray::from_vec(
+            vec![b"arrow", b"datafusion", b"flight", b"parquet", &[0xff, 0xf8]],
+        );
+        let scalar = "flight".as_bytes();
+        let expected = BooleanArray::from(vec![true, true, false, false, false]);
+
+        assert_eq!(lt_dyn_binary_scalar(&array, scalar).unwrap(), expected);
+        assert_eq!(
+            lt_dyn_binary_scalar(&large_array, scalar).unwrap(),
+            expected
+        );
+    }
+
+    #[test]
+    fn test_lt_eq_dyn_binary_scalar() {
+        let array = BinaryArray::from_vec(
+            vec![b"arrow", b"datafusion", b"flight", b"parquet", &[0xff, 0xf8]],
+        );
+        let large_array = LargeBinaryArray::from_vec(
+            vec![b"arrow", b"datafusion", b"flight", b"parquet", &[0xff, 0xf8]],
+        );
+        let scalar = "flight".as_bytes();
+        let expected = BooleanArray::from(vec![true, true, true, false, false]);
+
+        assert_eq!(lt_eq_dyn_binary_scalar(&array, scalar).unwrap(), expected);
+        assert_eq!(
+            lt_eq_dyn_binary_scalar(&large_array, scalar).unwrap(),
+            expected
+        );
+    }
+
+    #[test]
+    fn test_gt_dyn_binary_scalar() {
+        let array = BinaryArray::from_vec(
+            vec![b"arrow", b"datafusion", b"flight", b"parquet", &[0xff, 0xf8]],
+        );
+        let large_array = LargeBinaryArray::from_vec(
+            vec![b"arrow", b"datafusion", b"flight", b"parquet", &[0xff, 0xf8]],
+        );
+        let scalar = "flight".as_bytes();

Review comment:
       Perhaps one of these tests could use a non-UTF8 string as the scalar.

##########
File path: arrow/src/compute/kernels/comparison.rs
##########
@@ -3843,6 +3960,114 @@ mod tests {
         assert_eq!(neq_dyn_scalar(&array, 8).unwrap(), expected);
     }
 
+    #[test]

Review comment:
       Perhaps we could get a test with nulls?




-- 
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 #1238: dyn compare for binary array

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


   


-- 
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 change in pull request #1238: dyn compare for binary array

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



##########
File path: arrow/src/compute/kernels/comparison.rs
##########
@@ -3843,6 +3960,114 @@ mod tests {
         assert_eq!(neq_dyn_scalar(&array, 8).unwrap(), expected);
     }
 
+    #[test]

Review comment:
       Sure, I will add them




-- 
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 #1238: dyn compare for binary array

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


   # [Codecov](https://codecov.io/gh/apache/arrow-rs/pull/1238?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 [#1238](https://codecov.io/gh/apache/arrow-rs/pull/1238?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b73b3ed) into [master](https://codecov.io/gh/apache/arrow-rs/commit/66e029ebe41bcaa1754f88034deee500a7803fc8?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (66e029e) will **increase** coverage by `0.24%`.
   > The diff coverage is `89.75%`.
   
   > :exclamation: Current head b73b3ed differs from pull request most recent head fd97848. Consider uploading reports for the commit fd97848 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/arrow-rs/pull/1238/graphs/tree.svg?width=650&height=150&src=pr&token=pq9V9qWZ1N&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/arrow-rs/pull/1238?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #1238      +/-   ##
   ==========================================
   + Coverage   82.70%   82.95%   +0.24%     
   ==========================================
     Files         175      178       +3     
     Lines       51712    51516     -196     
   ==========================================
   - Hits        42770    42736      -34     
   + Misses       8942     8780     -162     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/arrow-rs/pull/1238?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/alloc/mod.rs](https://codecov.io/gh/apache/arrow-rs/pull/1238/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-YXJyb3cvc3JjL2FsbG9jL21vZC5ycw==) | `91.42% <ø> (-1.26%)` | :arrow_down: |
   | [arrow/src/array/mod.rs](https://codecov.io/gh/apache/arrow-rs/pull/1238/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-YXJyb3cvc3JjL2FycmF5L21vZC5ycw==) | `100.00% <ø> (ø)` | |
   | [arrow/src/buffer/immutable.rs](https://codecov.io/gh/apache/arrow-rs/pull/1238/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-YXJyb3cvc3JjL2J1ZmZlci9pbW11dGFibGUucnM=) | `98.92% <ø> (ø)` | |
   | [arrow/src/ipc/writer.rs](https://codecov.io/gh/apache/arrow-rs/pull/1238/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-YXJyb3cvc3JjL2lwYy93cml0ZXIucnM=) | `83.48% <0.00%> (-0.64%)` | :arrow_down: |
   | [arrow/src/array/transform/mod.rs](https://codecov.io/gh/apache/arrow-rs/pull/1238/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-YXJyb3cvc3JjL2FycmF5L3RyYW5zZm9ybS9tb2QucnM=) | `84.77% <76.00%> (-0.67%)` | :arrow_down: |
   | [parquet/src/arrow/array\_reader.rs](https://codecov.io/gh/apache/arrow-rs/pull/1238/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) | `78.19% <77.77%> (+0.74%)` | :arrow_up: |
   | [...et/src/arrow/array\_reader/byte\_array\_dictionary.rs](https://codecov.io/gh/apache/arrow-rs/pull/1238/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-cGFycXVldC9zcmMvYXJyb3cvYXJyYXlfcmVhZGVyL2J5dGVfYXJyYXlfZGljdGlvbmFyeS5ycw==) | `83.50% <83.50%> (ø)` | |
   | [parquet/src/arrow/array\_reader/byte\_array.rs](https://codecov.io/gh/apache/arrow-rs/pull/1238/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-cGFycXVldC9zcmMvYXJyb3cvYXJyYXlfcmVhZGVyL2J5dGVfYXJyYXkucnM=) | `85.71% <85.71%> (-1.35%)` | :arrow_down: |
   | [arrow/src/array/data.rs](https://codecov.io/gh/apache/arrow-rs/pull/1238/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=) | `83.02% <88.00%> (+0.74%)` | :arrow_up: |
   | [arrow/src/compute/kernels/comparison.rs](https://codecov.io/gh/apache/arrow-rs/pull/1238/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-YXJyb3cvc3JjL2NvbXB1dGUva2VybmVscy9jb21wYXJpc29uLnJz) | `91.67% <88.46%> (-0.30%)` | :arrow_down: |
   | ... and [22 more](https://codecov.io/gh/apache/arrow-rs/pull/1238/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/arrow-rs/pull/1238?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/1238?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 [66e029e...fd97848](https://codecov.io/gh/apache/arrow-rs/pull/1238?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] codecov-commenter commented on pull request #1238: dyn compare for binary array

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


   # [Codecov](https://codecov.io/gh/apache/arrow-rs/pull/1238?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 [#1238](https://codecov.io/gh/apache/arrow-rs/pull/1238?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b73b3ed) into [master](https://codecov.io/gh/apache/arrow-rs/commit/66e029ebe41bcaa1754f88034deee500a7803fc8?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (66e029e) will **increase** coverage by `0.24%`.
   > The diff coverage is `89.75%`.
   
   > :exclamation: Current head b73b3ed differs from pull request most recent head fd97848. Consider uploading reports for the commit fd97848 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/arrow-rs/pull/1238/graphs/tree.svg?width=650&height=150&src=pr&token=pq9V9qWZ1N&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/arrow-rs/pull/1238?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #1238      +/-   ##
   ==========================================
   + Coverage   82.70%   82.95%   +0.24%     
   ==========================================
     Files         175      178       +3     
     Lines       51712    51516     -196     
   ==========================================
   - Hits        42770    42736      -34     
   + Misses       8942     8780     -162     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/arrow-rs/pull/1238?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/alloc/mod.rs](https://codecov.io/gh/apache/arrow-rs/pull/1238/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-YXJyb3cvc3JjL2FsbG9jL21vZC5ycw==) | `91.42% <ø> (-1.26%)` | :arrow_down: |
   | [arrow/src/array/mod.rs](https://codecov.io/gh/apache/arrow-rs/pull/1238/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-YXJyb3cvc3JjL2FycmF5L21vZC5ycw==) | `100.00% <ø> (ø)` | |
   | [arrow/src/buffer/immutable.rs](https://codecov.io/gh/apache/arrow-rs/pull/1238/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-YXJyb3cvc3JjL2J1ZmZlci9pbW11dGFibGUucnM=) | `98.92% <ø> (ø)` | |
   | [arrow/src/ipc/writer.rs](https://codecov.io/gh/apache/arrow-rs/pull/1238/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-YXJyb3cvc3JjL2lwYy93cml0ZXIucnM=) | `83.48% <0.00%> (-0.64%)` | :arrow_down: |
   | [arrow/src/array/transform/mod.rs](https://codecov.io/gh/apache/arrow-rs/pull/1238/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-YXJyb3cvc3JjL2FycmF5L3RyYW5zZm9ybS9tb2QucnM=) | `84.77% <76.00%> (-0.67%)` | :arrow_down: |
   | [parquet/src/arrow/array\_reader.rs](https://codecov.io/gh/apache/arrow-rs/pull/1238/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) | `78.19% <77.77%> (+0.74%)` | :arrow_up: |
   | [...et/src/arrow/array\_reader/byte\_array\_dictionary.rs](https://codecov.io/gh/apache/arrow-rs/pull/1238/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-cGFycXVldC9zcmMvYXJyb3cvYXJyYXlfcmVhZGVyL2J5dGVfYXJyYXlfZGljdGlvbmFyeS5ycw==) | `83.50% <83.50%> (ø)` | |
   | [parquet/src/arrow/array\_reader/byte\_array.rs](https://codecov.io/gh/apache/arrow-rs/pull/1238/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-cGFycXVldC9zcmMvYXJyb3cvYXJyYXlfcmVhZGVyL2J5dGVfYXJyYXkucnM=) | `85.71% <85.71%> (-1.35%)` | :arrow_down: |
   | [arrow/src/array/data.rs](https://codecov.io/gh/apache/arrow-rs/pull/1238/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=) | `83.02% <88.00%> (+0.74%)` | :arrow_up: |
   | [arrow/src/compute/kernels/comparison.rs](https://codecov.io/gh/apache/arrow-rs/pull/1238/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-YXJyb3cvc3JjL2NvbXB1dGUva2VybmVscy9jb21wYXJpc29uLnJz) | `91.67% <88.46%> (-0.30%)` | :arrow_down: |
   | ... and [22 more](https://codecov.io/gh/apache/arrow-rs/pull/1238/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/arrow-rs/pull/1238?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/1238?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 [66e029e...fd97848](https://codecov.io/gh/apache/arrow-rs/pull/1238?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] tustvold commented on a change in pull request #1238: dyn compare for binary array

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



##########
File path: arrow/src/compute/kernels/comparison.rs
##########
@@ -3843,6 +3960,114 @@ mod tests {
         assert_eq!(neq_dyn_scalar(&array, 8).unwrap(), expected);
     }
 
+    #[test]
+    fn test_eq_dyn_binary_scalar() {
+        let array = BinaryArray::from_vec(
+            vec![b"arrow", b"datafusion", b"flight", b"parquet", &[0xff, 0xf8]],
+        );
+        let large_array = LargeBinaryArray::from_vec(
+            vec![b"arrow", b"datafusion", b"flight", b"parquet", &[0xff, 0xf8]],
+        );
+        let scalar = "flight".as_bytes();
+        let expected = BooleanArray::from(vec![false, false, true, false, false]);
+
+        assert_eq!(eq_dyn_binary_scalar(&array, scalar).unwrap(), expected);
+        assert_eq!(
+            eq_dyn_binary_scalar(&large_array, scalar).unwrap(),
+            expected
+        );
+    }
+
+    #[test]
+    fn test_neq_dyn_binary_scalar() {
+        let array = BinaryArray::from_vec(
+            vec![b"arrow", b"datafusion", b"flight", b"parquet", &[0xff, 0xf8]],
+        );
+        let large_array = LargeBinaryArray::from_vec(
+            vec![b"arrow", b"datafusion", b"flight", b"parquet", &[0xff, 0xf8]],
+        );
+        let scalar = "flight".as_bytes();
+        let expected = BooleanArray::from(vec![true, true, false, true, true]);
+
+        assert_eq!(neq_dyn_binary_scalar(&array, scalar).unwrap(), expected);
+        assert_eq!(
+            neq_dyn_binary_scalar(&large_array, scalar).unwrap(),
+            expected
+        );
+    }
+
+    #[test]
+    fn test_lt_dyn_binary_scalar() {
+        let array = BinaryArray::from_vec(
+            vec![b"arrow", b"datafusion", b"flight", b"parquet", &[0xff, 0xf8]],
+        );
+        let large_array = LargeBinaryArray::from_vec(
+            vec![b"arrow", b"datafusion", b"flight", b"parquet", &[0xff, 0xf8]],
+        );
+        let scalar = "flight".as_bytes();
+        let expected = BooleanArray::from(vec![true, true, false, false, false]);
+
+        assert_eq!(lt_dyn_binary_scalar(&array, scalar).unwrap(), expected);
+        assert_eq!(
+            lt_dyn_binary_scalar(&large_array, scalar).unwrap(),
+            expected
+        );
+    }
+
+    #[test]
+    fn test_lt_eq_dyn_binary_scalar() {
+        let array = BinaryArray::from_vec(
+            vec![b"arrow", b"datafusion", b"flight", b"parquet", &[0xff, 0xf8]],
+        );
+        let large_array = LargeBinaryArray::from_vec(
+            vec![b"arrow", b"datafusion", b"flight", b"parquet", &[0xff, 0xf8]],
+        );
+        let scalar = "flight".as_bytes();
+        let expected = BooleanArray::from(vec![true, true, true, false, false]);
+
+        assert_eq!(lt_eq_dyn_binary_scalar(&array, scalar).unwrap(), expected);
+        assert_eq!(
+            lt_eq_dyn_binary_scalar(&large_array, scalar).unwrap(),
+            expected
+        );
+    }
+
+    #[test]
+    fn test_gt_dyn_binary_scalar() {
+        let array = BinaryArray::from_vec(
+            vec![b"arrow", b"datafusion", b"flight", b"parquet", &[0xff, 0xf8]],
+        );
+        let large_array = LargeBinaryArray::from_vec(
+            vec![b"arrow", b"datafusion", b"flight", b"parquet", &[0xff, 0xf8]],
+        );
+        let scalar = "flight".as_bytes();

Review comment:
       Perhaps one of these tests could use a non-UTF8 string as the scalar.

##########
File path: arrow/src/compute/kernels/comparison.rs
##########
@@ -3843,6 +3960,114 @@ mod tests {
         assert_eq!(neq_dyn_scalar(&array, 8).unwrap(), expected);
     }
 
+    #[test]

Review comment:
       Perhaps we could get a test with nulls?




-- 
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 change in pull request #1238: dyn compare for binary array

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



##########
File path: arrow/src/compute/kernels/comparison.rs
##########
@@ -3843,6 +3960,114 @@ mod tests {
         assert_eq!(neq_dyn_scalar(&array, 8).unwrap(), expected);
     }
 
+    #[test]
+    fn test_eq_dyn_binary_scalar() {
+        let array = BinaryArray::from_vec(
+            vec![b"arrow", b"datafusion", b"flight", b"parquet", &[0xff, 0xf8]],
+        );
+        let large_array = LargeBinaryArray::from_vec(
+            vec![b"arrow", b"datafusion", b"flight", b"parquet", &[0xff, 0xf8]],
+        );
+        let scalar = "flight".as_bytes();
+        let expected = BooleanArray::from(vec![false, false, true, false, false]);
+
+        assert_eq!(eq_dyn_binary_scalar(&array, scalar).unwrap(), expected);
+        assert_eq!(
+            eq_dyn_binary_scalar(&large_array, scalar).unwrap(),
+            expected
+        );
+    }
+
+    #[test]
+    fn test_neq_dyn_binary_scalar() {
+        let array = BinaryArray::from_vec(
+            vec![b"arrow", b"datafusion", b"flight", b"parquet", &[0xff, 0xf8]],
+        );
+        let large_array = LargeBinaryArray::from_vec(
+            vec![b"arrow", b"datafusion", b"flight", b"parquet", &[0xff, 0xf8]],
+        );
+        let scalar = "flight".as_bytes();
+        let expected = BooleanArray::from(vec![true, true, false, true, true]);
+
+        assert_eq!(neq_dyn_binary_scalar(&array, scalar).unwrap(), expected);
+        assert_eq!(
+            neq_dyn_binary_scalar(&large_array, scalar).unwrap(),
+            expected
+        );
+    }
+
+    #[test]
+    fn test_lt_dyn_binary_scalar() {
+        let array = BinaryArray::from_vec(
+            vec![b"arrow", b"datafusion", b"flight", b"parquet", &[0xff, 0xf8]],
+        );
+        let large_array = LargeBinaryArray::from_vec(
+            vec![b"arrow", b"datafusion", b"flight", b"parquet", &[0xff, 0xf8]],
+        );
+        let scalar = "flight".as_bytes();
+        let expected = BooleanArray::from(vec![true, true, false, false, false]);
+
+        assert_eq!(lt_dyn_binary_scalar(&array, scalar).unwrap(), expected);
+        assert_eq!(
+            lt_dyn_binary_scalar(&large_array, scalar).unwrap(),
+            expected
+        );
+    }
+
+    #[test]
+    fn test_lt_eq_dyn_binary_scalar() {
+        let array = BinaryArray::from_vec(
+            vec![b"arrow", b"datafusion", b"flight", b"parquet", &[0xff, 0xf8]],
+        );
+        let large_array = LargeBinaryArray::from_vec(
+            vec![b"arrow", b"datafusion", b"flight", b"parquet", &[0xff, 0xf8]],
+        );
+        let scalar = "flight".as_bytes();
+        let expected = BooleanArray::from(vec![true, true, true, false, false]);
+
+        assert_eq!(lt_eq_dyn_binary_scalar(&array, scalar).unwrap(), expected);
+        assert_eq!(
+            lt_eq_dyn_binary_scalar(&large_array, scalar).unwrap(),
+            expected
+        );
+    }
+
+    #[test]
+    fn test_gt_dyn_binary_scalar() {
+        let array = BinaryArray::from_vec(
+            vec![b"arrow", b"datafusion", b"flight", b"parquet", &[0xff, 0xf8]],
+        );
+        let large_array = LargeBinaryArray::from_vec(
+            vec![b"arrow", b"datafusion", b"flight", b"parquet", &[0xff, 0xf8]],
+        );
+        let scalar = "flight".as_bytes();

Review comment:
       Done!




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