Skip to content

Commit 88aff18

Browse files
committed
NULL_PREFIX has to be negative infinity for floating point types
1 parent 613e16f commit 88aff18

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/src/main/java/org/apache/spark/util/collection/unsafe/sort/PrefixComparators.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public long computePrefix(float value) {
103103
return Float.floatToIntBits(value) & 0xffffffffL;
104104
}
105105

106-
public final long NULL_PREFIX = computePrefix(Float.MIN_VALUE);
106+
public final long NULL_PREFIX = computePrefix(Float.NEGATIVE_INFINITY);
107107
}
108108

109109
public static final class DoublePrefixComparator extends PrefixComparator {
@@ -118,6 +118,6 @@ public long computePrefix(double value) {
118118
return Double.doubleToLongBits(value);
119119
}
120120

121-
public final long NULL_PREFIX = computePrefix(Double.MIN_VALUE);
121+
public final long NULL_PREFIX = computePrefix(Double.NEGATIVE_INFINITY);
122122
}
123123
}

0 commit comments

Comments
 (0)