diff options
author | Sean Owen <sowen@cloudera.com> | 2016-03-03 15:11:02 +0000 |
---|---|---|
committer | Sean Owen <sowen@cloudera.com> | 2016-03-03 15:11:02 +0000 |
commit | 645c3a85e2029928d37ec2de9ef5a2d884620b9b (patch) | |
tree | a04f4c6e0f7136d16c44ef3600858990103b8bad /sql | |
parent | b5f02d6743ecb1633b7b13382f76cb8bfc2aa95c (diff) | |
download | spark-645c3a85e2029928d37ec2de9ef5a2d884620b9b.tar.gz spark-645c3a85e2029928d37ec2de9ef5a2d884620b9b.tar.bz2 spark-645c3a85e2029928d37ec2de9ef5a2d884620b9b.zip |
[SPARK-13423][HOTFIX] Static analysis fixes for 2.x / fixed for Scala 2.10
## What changes were proposed in this pull request?
Fixes compile problem due to inadvertent use of `Option.contains`, only in Scala 2.11. The change should have been to replace `Option.exists(_ == x)` with `== Some(x)`. Replacing exists with contains only makes sense for collections. Replacing use of `Option.exists` still makes sense though as it's misleading.
## How was this patch tested?
Jenkins tests / compilation
(If this patch involves UI changes, please attach a screenshot; otherwise, remove this)
Author: Sean Owen <sowen@cloudera.com>
Closes #11493 from srowen/SPARK-13423.2.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/core/src/main/scala/org/apache/spark/sql/execution/ui/SQLListener.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/ui/SQLListener.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/ui/SQLListener.scala index f9d10292f1..41762fc49c 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/execution/ui/SQLListener.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/ui/SQLListener.scala @@ -335,7 +335,7 @@ private[spark] class SQLHistoryListener(conf: SparkConf, sparkUI: SparkUI) taskEnd.taskInfo.accumulables.flatMap { a => // Filter out accumulators that are not SQL metrics // For now we assume all SQL metrics are Long's that have been JSON serialized as String's - if (a.metadata.contains(SQLMetrics.ACCUM_IDENTIFIER)) { + if (a.metadata == Some(SQLMetrics.ACCUM_IDENTIFIER)) { val newValue = new LongSQLMetricValue(a.update.map(_.toString.toLong).getOrElse(0L)) Some(a.copy(update = Some(newValue))) } else { |