aboutsummaryrefslogtreecommitdiff
path: root/mllib/src/test
diff options
context:
space:
mode:
authorChenliang Xu <chexu@groupon.com>2016-03-28 08:33:37 -0700
committerXiangrui Meng <meng@databricks.com>2016-03-28 08:33:37 -0700
commitc8388297c436691a236520d2396deaf556aedb0e (patch)
tree93d61dfa798ff03ae7af333825d9d7a7693b2d7c /mllib/src/test
parentb66aa900619a86b7acbb7c3f96abc96ea2faa53c (diff)
downloadspark-c8388297c436691a236520d2396deaf556aedb0e.tar.gz
spark-c8388297c436691a236520d2396deaf556aedb0e.tar.bz2
spark-c8388297c436691a236520d2396deaf556aedb0e.zip
[SPARK-14187][MLLIB] Fix incorrect use of binarySearch in SparseMatrix
## What changes were proposed in this pull request? Fix incorrect use of binarySearch in SparseMatrix ## How was this patch tested? Unit test added. Author: Chenliang Xu <chexu@groupon.com> Closes #11992 from luckyrandom/SPARK-14187.
Diffstat (limited to 'mllib/src/test')
-rw-r--r--mllib/src/test/scala/org/apache/spark/mllib/linalg/MatricesSuite.scala4
1 files changed, 4 insertions, 0 deletions
diff --git a/mllib/src/test/scala/org/apache/spark/mllib/linalg/MatricesSuite.scala b/mllib/src/test/scala/org/apache/spark/mllib/linalg/MatricesSuite.scala
index a02b8c9635..57907f415c 100644
--- a/mllib/src/test/scala/org/apache/spark/mllib/linalg/MatricesSuite.scala
+++ b/mllib/src/test/scala/org/apache/spark/mllib/linalg/MatricesSuite.scala
@@ -150,6 +150,10 @@ class MatricesSuite extends SparkFunSuite {
sparseMat.update(0, 0, 10.0)
}
+ intercept[NoSuchElementException] {
+ sparseMat.update(2, 1, 10.0)
+ }
+
sparseMat.update(0, 1, 10.0)
assert(sparseMat(0, 1) === 10.0)
assert(sparseMat.values(2) === 10.0)