You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by jk...@apache.org on 2016/09/06 21:21:03 UTC
spark git commit: [MINOR] Remove unnecessary check in MLSerDe
Repository: spark
Updated Branches:
refs/heads/master 7775d9f22 -> 8bbb08a30
[MINOR] Remove unnecessary check in MLSerDe
## What changes were proposed in this pull request?
1, remove unnecessary `require()`, because it will make following check useless.
2, update the error msg.
## How was this patch tested?
no test
Author: Zheng RuiFeng <ru...@foxmail.com>
Closes #14972 from zhengruifeng/del_unnecessary_check.
Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/8bbb08a3
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/8bbb08a3
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/8bbb08a3
Branch: refs/heads/master
Commit: 8bbb08a3001313b53a5d854ef442d82d4c7e1d5d
Parents: 7775d9f
Author: Zheng RuiFeng <ru...@foxmail.com>
Authored: Tue Sep 6 14:20:56 2016 -0700
Committer: Joseph K. Bradley <jo...@databricks.com>
Committed: Tue Sep 6 14:20:56 2016 -0700
----------------------------------------------------------------------
.../src/main/scala/org/apache/spark/ml/python/MLSerDe.scala | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/spark/blob/8bbb08a3/mllib/src/main/scala/org/apache/spark/ml/python/MLSerDe.scala
----------------------------------------------------------------------
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 1279c90..4b805e1 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))
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org