Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Added compare_scalar #317

Merged
merged 2 commits into from Aug 22, 2021
Merged

Added compare_scalar #317

merged 2 commits into from Aug 22, 2021

Conversation

jorgecarleitao
Copy link
Owner

@jorgecarleitao jorgecarleitao commented Aug 22, 2021

This PR adds a new function, arrow2::compute::comparison::compare_scalar with signature

compare_scalar(lhs: &dyn Array, rhs: &dyn Scalar, operator: Operator) -> Result<BooleanArray>

that compares a &dyn array with a &dyn scalar (error if not of the same datatype). This allows implementations to not have to select the right implementation based on the data_type.

All implementations of *_scalar were also stripped from the Result<>, since they were infallible (backward-incompatible).

Closes #316

@codecov
Copy link

codecov bot commented Aug 22, 2021

Codecov Report

Merging #317 (beb56c6) into main (d278f08) will decrease coverage by 0.02%.
The diff coverage is 84.84%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #317      +/-   ##
==========================================
- Coverage   80.55%   80.52%   -0.03%     
==========================================
  Files         324      324              
  Lines       21277    21369      +92     
==========================================
+ Hits        17140    17208      +68     
- Misses       4137     4161      +24     
Impacted Files Coverage Δ
src/compute/comparison/utf8.rs 68.81% <60.00%> (-12.52%) ⬇️
src/compute/comparison/boolean.rs 63.75% <61.53%> (+0.59%) ⬆️
src/compute/comparison/primitive.rs 90.17% <84.61%> (-4.92%) ⬇️
src/compute/comparison/mod.rs 91.55% <89.10%> (-2.06%) ⬇️
src/scalar/primitive.rs 95.45% <0.00%> (+4.54%) ⬆️
src/scalar/mod.rs 66.66% <0.00%> (+21.21%) ⬆️

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 d278f08...beb56c6. Read the comment docs.

@jorgecarleitao jorgecarleitao merged commit 8243861 into main Aug 22, 2021
@jorgecarleitao jorgecarleitao deleted the cmp_scalar branch August 22, 2021 22:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make *_compare_scalar not return Result
1 participant