File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
core/src/main/java/org/apache/spark/util/collection/unsafe/sort
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -75,9 +75,9 @@ public static long computePrefix(byte[] bytes) {
7575 */
7676 final int minLen = Math .min (bytes .length , 8 );
7777 long p = 0 ;
78- for (int i = 1 ; i <= minLen ; ++i ) {
79- p |= (128L + PlatformDependent .UNSAFE .getByte (bytes , BYTE_ARRAY_OFFSET + i - 1 ))
80- << (64 - 8 * i );
78+ for (int i = 0 ; i < minLen ; ++i ) {
79+ p |= (128L + PlatformDependent .UNSAFE .getByte (bytes , BYTE_ARRAY_OFFSET + i ))
80+ << (56 - 8 * i );
8181 }
8282 return p ;
8383 }
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ case class SortPrefix(child: SortOrder) extends UnaryExpression {
7878 (DoublePrefixComparator .computePrefix(Double .NegativeInfinity ),
7979 s " $DoublePrefixCmp.computePrefix((double) $input) " )
8080 case StringType => (0L , s " $input.getPrefix() " )
81- case BinaryType => (0L , s " $BinaryPrefixCmp.computePrefix((byte[]) $input) " )
81+ case BinaryType => (0L , s " $BinaryPrefixCmp.computePrefix( $input) " )
8282 case dt : DecimalType if dt.precision - dt.scale <= Decimal .MAX_LONG_DIGITS =>
8383 val prefix = if (dt.precision <= Decimal .MAX_LONG_DIGITS ) {
8484 s " $input.toUnscaledLong() "
You can’t perform that action at this time.
0 commit comments