diff options
Diffstat (limited to 'mllib/src/main')
-rw-r--r-- | mllib/src/main/scala/org/apache/spark/ml/python/MLSerDe.scala | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/mllib/src/main/scala/org/apache/spark/ml/python/MLSerDe.scala b/mllib/src/main/scala/org/apache/spark/ml/python/MLSerDe.scala index 1279c901c5..4b805e1454 100644 --- a/mllib/src/main/scala/org/apache/spark/ml/python/MLSerDe.scala +++ b/mllib/src/main/scala/org/apache/spark/ml/python/MLSerDe.scala @@ -56,9 +56,8 @@ private[spark] object MLSerDe extends SerDeBase with Serializable { } def construct(args: Array[Object]): Object = { - require(args.length == 1) if (args.length != 1) { - throw new PickleException("should be 1") + throw new PickleException("length of args should be 1") } val bytes = getBytes(args(0)) val bb = ByteBuffer.wrap(bytes, 0, bytes.length) @@ -95,7 +94,7 @@ private[spark] object MLSerDe extends SerDeBase with Serializable { def construct(args: Array[Object]): Object = { if (args.length != 4) { - throw new PickleException("should be 4") + throw new PickleException("length of args should be 4") } val bytes = getBytes(args(2)) val n = bytes.length / 8 @@ -143,7 +142,7 @@ private[spark] object MLSerDe extends SerDeBase with Serializable { def construct(args: Array[Object]): Object = { if (args.length != 6) { - throw new PickleException("should be 6") + throw new PickleException("length of args should be 6") } val order = ByteOrder.nativeOrder() val colPtrsBytes = getBytes(args(2)) @@ -187,7 +186,7 @@ private[spark] object MLSerDe extends SerDeBase with Serializable { def construct(args: Array[Object]): Object = { if (args.length != 3) { - throw new PickleException("should be 3") + throw new PickleException("length of args should be 3") } val size = args(0).asInstanceOf[Int] val indiceBytes = getBytes(args(1)) |