diff options
author | Robert Dodier <robert_dodier@users.sourceforge.net> | 2016-01-06 19:49:10 -0800 |
---|---|---|
committer | Joseph K. Bradley <joseph@databricks.com> | 2016-01-06 19:49:10 -0800 |
commit | 6b6d02be0d4e2ce562dddfb391b3302f79de8276 (patch) | |
tree | 911254f522b0e4636e54e68b1c44f5fd92aa7627 | |
parent | a74d743cc7c52a78fa023fdd0d06847b7d48bf78 (diff) | |
download | spark-6b6d02be0d4e2ce562dddfb391b3302f79de8276.tar.gz spark-6b6d02be0d4e2ce562dddfb391b3302f79de8276.tar.bz2 spark-6b6d02be0d4e2ce562dddfb391b3302f79de8276.zip |
[SPARK-12663][MLLIB] More informative error message in MLUtils.loadLibSVMFile
This PR contains 1 commit which resolves [SPARK-12663](https://issues.apache.org/jira/browse/SPARK-12663).
For the record, I got a positive response from 2 people when I floated this idea on devspark.apache.org on 2015-10-23. [Link to archived discussion.](http://apache-spark-developers-list.1001551.n3.nabble.com/slightly-more-informative-error-message-in-MLUtils-loadLibSVMFile-td14764.html)
Author: Robert Dodier <robert_dodier@users.sourceforge.net>
Closes #10611 from robert-dodier/loadlibsvmfile-error-msg-branch.
-rw-r--r-- | mllib/src/main/scala/org/apache/spark/mllib/util/MLUtils.scala | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/mllib/src/main/scala/org/apache/spark/mllib/util/MLUtils.scala b/mllib/src/main/scala/org/apache/spark/mllib/util/MLUtils.scala index 89186de969..74e9271e40 100644 --- a/mllib/src/main/scala/org/apache/spark/mllib/util/MLUtils.scala +++ b/mllib/src/main/scala/org/apache/spark/mllib/util/MLUtils.scala @@ -86,7 +86,8 @@ object MLUtils { val indicesLength = indices.length while (i < indicesLength) { val current = indices(i) - require(current > previous, "indices should be one-based and in ascending order" ) + require(current > previous, s"indices should be one-based and in ascending order;" + + " found current=$current, previous=$previous; line=\"$line\"") previous = current i += 1 } |