-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-10134][SQL]Optimization for binary comparison #8335
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
Conversation
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.
Do we need to cache the comparator?
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.
No, not necessary, as lexicographicalComparator() used a static compactor instance internally.
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.
Actually it's a static final, the function call here should be very easy to be inlined in JIT I think.
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.
use SignedBytes.lexicographicalComparator().compare(x, y) instead.
|
Test build #41312 has finished for PR 8335 at commit
|
|
I read the code and find the comparator used here is not the same as we previously implemented. While for |
|
so let's try |
|
Yes, true, I thought all of the binary sorting result will be changed once we update this function, however, seems not. Probably some binary comparison code somewhere else. |
|
Test build #41354 has finished for PR 8335 at commit
|
|
Closing the Guava(SignedBytes) has exactly the same implementation as current master code. |
In jdk9, probably we can use the JDK API directly for the binary comparison.
https://bugs.openjdk.java.net/browse/JDK-8033148