Github user original-brownbear commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19180#discussion_r137956036
  
    --- Diff: 
common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java ---
    @@ -1097,8 +1101,21 @@ public UTF8String copy() {
       @Override
       public int compareTo(@Nonnull final UTF8String other) {
         int len = Math.min(numBytes, other.numBytes);
    -    // TODO: compare 8 bytes as unsigned long
    -    for (int i = 0; i < len; i ++) {
    +    int words = len / Longs.BYTES;
    +    long roffset = other.getBaseOffset();
    +    Object rbase = other.getBaseObject();
    +    for (int i = 0; i < words * Longs.BYTES; i += Longs.BYTES) {
    +      long left = getLong(base, offset + i);
    +      long right = getLong(rbase, roffset + i);
    +      if (left != right) {
    +        if (!IS_LITTLE_ENDIAN) {
    --- End diff --
    
    @kiszk I don't think so, even if you update a primitive constant by 
reflection, all its inlined uses will not be updated. See 
http://java-performance.info/updating-final-and-static-final-fields/ who coded 
up an example of this at the bottom of the article.
    Reflection updates will only update what you get back from reflection field 
access.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to