Skip to content
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

implement eq_dyn, neq_dyn, lt_dyn, lt_eq_dyn, gt_dyn, gt_eq_dyn #858

Merged
merged 1 commit into from
Oct 26, 2021

Conversation

jimexist
Copy link
Member

@jimexist jimexist commented Oct 24, 2021

Which issue does this PR close?

Closes #843

Rationale for this change

to reduce casting on the call sites

What changes are included in this PR?

implement:

  1. eq_dyn
  2. neq_dyn
  3. lt_dyn
  4. lt_eq_dyn
  5. gt_dyn
  6. gt_eq_dyn

Are there any user-facing changes?

@github-actions github-actions bot added the arrow Changes to the arrow crate label Oct 24, 2021
@jimexist jimexist changed the title implement eq_dyn and neq_dyn implement eq_dyn, neq_dyn, lt_dyn, lt_eq_dyn, gt_dyn, gt_eq_dyn Oct 24, 2021
@codecov-commenter
Copy link

codecov-commenter commented Oct 24, 2021

Codecov Report

Merging #858 (a7c0694) into master (2662bd8) will decrease coverage by 0.01%.
The diff coverage is 50.00%.

❗ Current head a7c0694 differs from pull request most recent head 08b53e5. Consider uploading reports for the commit 08b53e5 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master     #858      +/-   ##
==========================================
- Coverage   82.66%   82.65%   -0.02%     
==========================================
  Files         168      168              
  Lines       48172    48196      +24     
==========================================
+ Hits        39823    39834      +11     
- Misses       8349     8362      +13     
Impacted Files Coverage Δ
arrow/src/compute/kernels/comparison.rs 92.63% <50.00%> (-1.48%) ⬇️
parquet/src/encodings/encoding.rs 94.48% <0.00%> (-0.20%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2662bd8...08b53e5. Read the comment docs.

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks really nice @jimexist -- thank you!

FWIW I took a friendly look at what arrow2 does for this situation and I think this PR is not inconsistent. Arrow2 appears to have a function called arithmetic which does the type dispatch on the parameter types and an Operator enum:
https://github.com/jorgecarleitao/arrow2/blob/main/src/compute/arithmetics/mod.rs#L91

While an Operator enum seems like a reasonable thing to consider adding to arrow-rs it is also likely fine to do as a follow on (as we already have different kernels for different operations)

cc @jorgecarleitao

@@ -1245,11 +1431,17 @@ mod tests {
/// `EXPECTED` can be either `Vec<bool>` or `Vec<Option<bool>>`.
/// The main reason for this macro is that inputs and outputs align nicely after `cargo fmt`.
macro_rules! cmp_i64 {
($KERNEL:ident, $A_VEC:expr, $B_VEC:expr, $EXPECTED:expr) => {
($KERNEL:ident, $DYN_KERNEL:ident, $A_VEC:expr, $B_VEC:expr, $EXPECTED:expr) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add compute kernels that operate on ArrayRef -- e.g eq_dyn
4 participants