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/11/06 19:05:07 UTC

[GitHub] [arrow-rs] tustvold opened a new pull request, #3034: Fix nullif when existing array has no nulls

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

   # 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 #3031
   
   # 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 diff in pull request #3034: Fix nullif when existing array has no nulls

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


##########
arrow/src/compute/kernels/boolean.rs:
##########
@@ -472,7 +472,7 @@ pub fn is_not_null(input: &dyn Array) -> Result<BooleanArray> {
 }
 
 /// Copies original array, setting validity bit to false if a secondary comparison
-/// boolean array is set to true or null
+/// boolean array is set to true

Review Comment:
   I incorrectly changed this doc in https://github.com/apache/arrow-rs/pull/2940/files#diff-036c91a4b91e350837448f27da4ac4c0b43cfb477571330ac1f37654b0e2c172L471



-- 
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 #3034: Fix nullif when existing array has no nulls

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


-- 
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 a diff in pull request #3034: Fix nullif when existing array has no nulls

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


##########
arrow/src/compute/kernels/boolean.rs:
##########
@@ -522,11 +522,19 @@ pub fn nullif(left: &dyn Array, right: &BooleanArray) -> Result<ArrayRef> {
                 t
             })
         }
-        None => bitwise_unary_op_helper(&right, right_offset, len, |b| {
-            let t = !b;
-            valid_count += t.count_ones() as usize;
-            t
-        }),
+        None => {
+            let buffer = bitwise_unary_op_helper(&right, right_offset, len, |b| {
+                let t = !b;
+                valid_count += t.count_ones() as usize;
+                t
+            });
+            // We need to compensate for the additional bits read from the end
+            let remainder_len = len % 64;
+            if remainder_len != 0 {
+                valid_count -= 64 - remainder_len
+            }
+            buffer

Review Comment:
   Should we also compensate valid_count for left_data.null_buffer() is Some case?



-- 
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 #3034: Fix nullif when existing array has no nulls

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

   Benchmark runs are scheduled for baseline = deb64554f9d25afa044248293b31ab7c26f0e42f and contender = 12f0ef4ac424e035e480a140088914e631607cae. 12f0ef4ac424e035e480a140088914e631607cae 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/4190e465497e47a9bda8eaf472fe9db5...25239a6f6b1948d0b0fb49e2f18d0a7b/)
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on test-mac-arm] [test-mac-arm](https://conbench.ursa.dev/compare/runs/e093dea9c69d47838dd9208859739831...30693da74b094371b6f247c87612771b/)
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ursa-i9-9960x] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/64ce576f48ed417f83e66bfe113a133f...c5d5e3d839324ca1b40c3cda2c182b1c/)
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ursa-thinkcentre-m75q] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/17f01be0d90e438fb995ceda2cb5424f...6fadb0b3ad7546a99b796255d616d2c0/)
   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


[GitHub] [arrow-rs] tustvold commented on a diff in pull request #3034: Fix nullif when existing array has no nulls

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


##########
arrow/src/compute/kernels/boolean.rs:
##########
@@ -522,11 +522,19 @@ pub fn nullif(left: &dyn Array, right: &BooleanArray) -> Result<ArrayRef> {
                 t
             })
         }
-        None => bitwise_unary_op_helper(&right, right_offset, len, |b| {
-            let t = !b;
-            valid_count += t.count_ones() as usize;
-            t
-        }),
+        None => {
+            let buffer = bitwise_unary_op_helper(&right, right_offset, len, |b| {
+                let t = !b;
+                valid_count += t.count_ones() as usize;
+                t
+            });
+            // We need to compensate for the additional bits read from the end
+            let remainder_len = len % 64;
+            if remainder_len != 0 {
+                valid_count -= 64 - remainder_len
+            }
+            buffer

Review Comment:
   Shouldn't need to as remainder u64 is masked to be 0 in the trailing positions, which when and-ed will not yield valid bits



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