You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "Dhruvit96 (via GitHub)" <gi...@apache.org> on 2025/09/14 18:26:29 UTC

[PR] use xnor for boolean equals function [arrow-go]

Dhruvit96 opened a new pull request, #505:
URL: https://github.com/apache/arrow-go/pull/505

   ### Rationale for this change
   fixes https://github.com/apache/arrow-go/issues/493
   
   ### What changes are included in this PR?
   Add bitxnor operation, utilize bitxnor for boolean equality.
   
   ### Are these changes tested?
   Yes
   
   ### Are there any user-facing changes?
   Boolean equality operations now return correct results. No changes to the public API.
   


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


Re: [PR] use xnor for boolean equals function [arrow-go]

Posted by "Dhruvit96 (via GitHub)" <gi...@apache.org>.
Dhruvit96 commented on code in PR #505:
URL: https://github.com/apache/arrow-go/pull/505#discussion_r2355596091


##########
arrow/compute/internal/kernels/scalar_comparisons.go:
##########
@@ -589,7 +591,7 @@ func compareTimestampKernel(ty exec.InputType, op CompareOperator) exec.ScalarKe
 var (
 	boolEQ = binaryBoolOps{
 		arrArr: func(_ *exec.KernelCtx, lhs, rhs, out bitutil.Bitmap) error {
-			bitutil.BitmapAnd(lhs.Data, rhs.Data, lhs.Offset, rhs.Offset, out.Data, out.Offset, out.Len)
+			bitutil.BitmapXnor(lhs.Data, rhs.Data, lhs.Offset, rhs.Offset, out.Data, out.Offset, out.Len)

Review Comment:
   Added unit test for checking boolean equals and not equals functions.



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


Re: [PR] use xnor for boolean equals function [arrow-go]

Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade merged PR #505:
URL: https://github.com/apache/arrow-go/pull/505


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


Re: [PR] use xnor for boolean equals function [arrow-go]

Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade commented on code in PR #505:
URL: https://github.com/apache/arrow-go/pull/505#discussion_r2353744845


##########
arrow/compute/internal/kernels/scalar_comparisons.go:
##########
@@ -589,7 +591,7 @@ func compareTimestampKernel(ty exec.InputType, op CompareOperator) exec.ScalarKe
 var (
 	boolEQ = binaryBoolOps{
 		arrArr: func(_ *exec.KernelCtx, lhs, rhs, out bitutil.Bitmap) error {
-			bitutil.BitmapAnd(lhs.Data, rhs.Data, lhs.Offset, rhs.Offset, out.Data, out.Offset, out.Len)
+			bitutil.BitmapXnor(lhs.Data, rhs.Data, lhs.Offset, rhs.Offset, out.Data, out.Offset, out.Len)

Review Comment:
   Can you add a test to `scalar_comparisons_test.go` which tests Boolean scalar equal? I'm assuming we must not have a test in there for this, otherwise it would have been caught sooner.



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