-
Notifications
You must be signed in to change notification settings - Fork 816
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add (simd) modulus op #317
Conversation
After this PR is merged, I will submit a new PR to |
@jorgecarleitao First-time contributors need a maintainer to approve running workflows. |
let null_bit_buffer = | ||
combine_option_bitmap(left.data_ref(), right.data_ref(), left.len())?; | ||
|
||
let buffer = if let Some(b) = &null_bit_buffer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be better to check if the null count > 0, as there could be a buffer even though all values are non-null
Codecov Report
@@ Coverage Diff @@
## master #317 +/- ##
==========================================
+ Coverage 82.52% 82.59% +0.06%
==========================================
Files 162 162
Lines 44007 44344 +337
==========================================
+ Hits 36316 36624 +308
- Misses 7691 7720 +29
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great to me @gangliao -- I am sorry I did not have a chance to review this carefully previously.
I reviewed all test cases carefully and they look good. Very impressive work 👍
let a = Int32Array::from(vec![15, 15, 8, 1, 9]); | ||
let b = Int32Array::from(vec![5, 6, 8, 9, 1]); | ||
let c = modulus(&a, &b).unwrap(); | ||
assert_eq!(0, c.value(0)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is possible to compare the c
in fewer lines using something like assert_eq!(c, Int32Array:from(vec![3. 0, 2, 3, 4])
, which also has the advantage if ensuring that c.len() == 5
. This way is fine too
Can anyone merge this PR so that I can proceed with other PR in arrow-datafusion? @alamb @jorgecarleitao |
Sorry @gangliao ! |
* Add (simd) modulus op * fix typo * fix feature = "simd" * revert ModulusByZero
Which issue does this PR close?
#98
apache/datafusion#99
Rationale for this change
What changes are included in this PR?
support modulus operations.
Are there any user-facing changes?
no.