Skip to content

Commit 6ddac0e

Browse files
committed
reverse the machine code for float/double
1 parent d2d5b5b commit 6ddac0e

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

core/src/main/scala/org/apache/spark/api/python/SerDeUtil.scala

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,13 @@ private[spark] object SerDeUtil extends Logging {
5656
// {'\0', 0, 0, 0} /* Sentinel */
5757
// };
5858
// TODO: support Py_UNICODE with 2 bytes
59-
// FIXME: unpickle array of float is wrong in Pyrolite, so we reverse the
60-
// machine code for float/double here to workaround it.
61-
// we should fix this after Pyrolite fix them
6259
val machineCodes: Map[Char, Int] = if (ByteOrder.nativeOrder().equals(ByteOrder.BIG_ENDIAN)) {
6360
Map('c' -> 1, 'B' -> 0, 'b' -> 1, 'H' -> 3, 'h' -> 5, 'I' -> 7, 'i' -> 9,
64-
'L' -> 11, 'l' -> 13, 'f' -> 14, 'd' -> 16, 'u' -> 21
61+
'L' -> 11, 'l' -> 13, 'f' -> 15, 'd' -> 17, 'u' -> 21
6562
)
6663
} else {
6764
Map('c' -> 1, 'B' -> 0, 'b' -> 1, 'H' -> 2, 'h' -> 4, 'I' -> 6, 'i' -> 8,
68-
'L' -> 10, 'l' -> 12, 'f' -> 15, 'd' -> 17, 'u' -> 20
65+
'L' -> 10, 'l' -> 12, 'f' -> 14, 'd' -> 16, 'u' -> 20
6966
)
7067
}
7168
override def construct(args: Array[Object]): Object = {

0 commit comments

Comments
 (0)