Uh oh!
There was an error while loading. Please reload this page.
[SPARK-24834][CORE] use java comparison for float and double - #21794
[SPARK-24834][CORE] use java comparison for float and double#21794bavardage wants to merge 1 commit into
Conversation
The methods in `Util`, `nanSafeCompareDoubles` and `nanSafeCompareFloats` had the same semantics as java's `java.lang.Double.compare` and `java.lang.Float.compare` respectively.
AmplabJenkins
commented
Jul 17, 2018
Can one of the admins verify this patch? |
bavardage
commented
Jul 17, 2018
cc @JoshRosen who introduced this code originally, I think |
bavardage
commented
Jul 17, 2018
There is a way in which the
If that behaviour is indeed required, I could abandon this PR and instead fix the test cases to capture this. |
kiszk
commented
Jul 17, 2018
I think this is required since SparkSQL does not distinguish 0.0 from -0.0. Am I correct? |
kiszk
commented
Jul 17, 2018
It would be good to add test cases for them since it is not covered now. |
srowen
commented
Jul 17, 2018
BTW if it becomes necessary to not change the semantics, I think the methods could at least be streamlined a bit: More tests can't hurt, too. |
bavardage
commented
Jul 18, 2018
it does seem that spark currently does distinguish -0 and 0, at least as far as groupbys go doubles are hashed via |
srowen
commented
Jul 18, 2018
|
srowen
commented
Aug 17, 2018
I think we'd have to close this due to the behavior change, but would merge an optimization of the existing behavior. |
bavardage
commented
Aug 22, 2018
yep fair - the intent I think was clarity rather than necessarily perf: it's misleading to have a method named 'nan safe' which has no special handling of nans. I'll look at opening a different PR which could increase clarity/may have minor perf benefit. |
Closesapache#16411Closesapache#21870Closesapache#21794Closesapache#21610Closesapache#21961Closesapache#21940Closesapache#21870Closesapache#22118Closesapache#21624Closesapache#19528Closesapache#18424Closesapache#22159 from srowen/Stale. Authored-by: Sean Owen <sean.owen@databricks.com> Signed-off-by: Sean Owen <sean.owen@databricks.com>
The methods in
Utils,nanSafeCompareDoublesandnanSafeCompareFloatshavethe same semantics as java's
java.lang.Double.compareandjava.lang.Float.comparerespectively.
What changes were proposed in this pull request?
Remove the two functions in
Utils, and replace the call sites (only two for each function) with the corresponding java comparison function.How was this patch tested?
Existing spark tests should cover this.