-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
ARROW-5844: [Java] Support comparison & sort for more numeric types #4799
Conversation
java/algorithm/src/main/java/org/apache/arrow/algorithm/sort/DefaultVectorComparators.java
Outdated
Show resolved
Hide resolved
java/algorithm/src/main/java/org/apache/arrow/algorithm/sort/DefaultVectorComparators.java
Outdated
Show resolved
Hide resolved
java/algorithm/src/main/java/org/apache/arrow/algorithm/sort/DefaultVectorComparators.java
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #4799 +/- ##
==========================================
+ Coverage 87.44% 89.59% +2.15%
==========================================
Files 997 662 -335
Lines 139728 96351 -43377
Branches 1418 0 -1418
==========================================
- Hits 122181 86327 -35854
+ Misses 17185 10024 -7161
+ Partials 362 0 -362
Continue to review full report at Codecov.
|
java/algorithm/src/main/java/org/apache/arrow/algorithm/sort/DefaultVectorComparators.java
Outdated
Show resolved
Hide resolved
java/algorithm/src/main/java/org/apache/arrow/algorithm/sort/DefaultVectorComparators.java
Outdated
Show resolved
Hide resolved
java/algorithm/src/main/java/org/apache/arrow/algorithm/sort/DefaultVectorComparators.java
Outdated
Show resolved
Hide resolved
} | ||
} | ||
|
||
float result = Math.signum(value1 - value2); |
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 seems like you should either directly return the casted signum or use the if statement, not both?
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.
Sure. Thanks a lot.
+1, LGTM. |
Currently, we only support comparison & sort for 32-bit integers, in this issue, we provide support for more numeric data types: byte short long float double Author: liyafan82 <[email protected]> Closes #4799 from liyafan82/fly_0704_cmp and squashes the following commits: a921cdd <liyafan82> Remove if conditons in default float & double comparators a4b4099 <liyafan82> Replace if condition with signum function 30f946b <liyafan82> Merge branch 'master' into fly_0704_cmp bc880f1 <liyafan82> Merge branch 'master' into fly_0704_cmp 7cbe556 <liyafan82> Support NaN for float and double 3860c11 <liyafan82> Support comparison & sort for more numeric types
Currently, we only support comparison & sort for 32-bit integers, in this issue, we provide support for more numeric data types:
byte
short
long
float
double