diff options
author | Sean Owen <sowen@cloudera.com> | 2017-07-13 17:06:24 +0800 |
---|---|---|
committer | Wenchen Fan <wenchen@databricks.com> | 2017-07-13 17:06:24 +0800 |
commit | 425c4ada4c24e338b45d0e9987071f05c5766fa5 (patch) | |
tree | 86102eafaff89199b00280c4bad65035ee3d2061 /mllib-local | |
parent | e08d06b37bc96cc48fec1c5e40f73e0bca09c616 (diff) |
[SPARK-19810][BUILD][CORE] Remove support for Scala 2.10
## What changes were proposed in this pull request?
- Remove Scala 2.10 build profiles and support
- Replace some 2.10 support in scripts with commented placeholders for 2.12 later
- Remove deprecated API calls from 2.10 support
- Remove usages of deprecated context bounds where possible
- Remove Scala 2.10 workarounds like ScalaReflectionLock
- Other minor Scala warning fixes
## How was this patch tested?
Existing tests
Author: Sean Owen <sowen@cloudera.com>
Closes #17150 from srowen/SPARK-19810.
Diffstat (limited to 'mllib-local')
-rw-r--r-- | mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala | 2 | ||||
-rw-r--r-- | mllib-local/src/test/scala/org/apache/spark/ml/linalg/MatricesSuite.scala | 20 |
2 files changed, 11 insertions, 11 deletions
diff --git a/mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala b/mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala index 07f3bc2728..66c5362441 100644 --- a/mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala +++ b/mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala @@ -856,7 +856,7 @@ object SparseMatrix { var prevRow = -1 var prevVal = 0.0 // Append a dummy entry to include the last one at the end of the loop. - (sortedEntries.view :+ (numRows, numCols, 1.0)).foreach { case (i, j, v) => + (sortedEntries.view :+ ((numRows, numCols, 1.0))).foreach { case (i, j, v) => if (v != 0) { if (i == prevRow && j == prevCol) { prevVal += v diff --git a/mllib-local/src/test/scala/org/apache/spark/ml/linalg/MatricesSuite.scala b/mllib-local/src/test/scala/org/apache/spark/ml/linalg/MatricesSuite.scala index 9f82020868..7fb9034d65 100644 --- a/mllib-local/src/test/scala/org/apache/spark/ml/linalg/MatricesSuite.scala +++ b/mllib-local/src/test/scala/org/apache/spark/ml/linalg/MatricesSuite.scala @@ -633,22 +633,22 @@ class MatricesSuite extends SparkMLFunSuite { dnMap.put((i, j), value) } assert(dnMap.size === 6) - assert(dnMap(0, 0) === 1.0) - assert(dnMap(1, 0) === 2.0) - assert(dnMap(2, 0) === 0.0) - assert(dnMap(0, 1) === 0.0) - assert(dnMap(1, 1) === 4.0) - assert(dnMap(2, 1) === 5.0) + assert(dnMap((0, 0)) === 1.0) + assert(dnMap((1, 0)) === 2.0) + assert(dnMap((2, 0)) === 0.0) + assert(dnMap((0, 1)) === 0.0) + assert(dnMap((1, 1)) === 4.0) + assert(dnMap((2, 1)) === 5.0) val spMap = MutableMap[(Int, Int), Double]() sp.foreachActive { (i, j, value) => spMap.put((i, j), value) } assert(spMap.size === 4) - assert(spMap(0, 0) === 1.0) - assert(spMap(1, 0) === 2.0) - assert(spMap(1, 1) === 4.0) - assert(spMap(2, 1) === 5.0) + assert(spMap((0, 0)) === 1.0) + assert(spMap((1, 0)) === 2.0) + assert(spMap((1, 1)) === 4.0) + assert(spMap((2, 1)) === 5.0) } test("horzcat, vertcat, eye, speye") { |