You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by rx...@apache.org on 2017/03/25 00:07:54 UTC

spark git commit: [SPARK-20070][SQL] Fix 2.10 build

Repository: spark
Updated Branches:
  refs/heads/master f88f56b83 -> 0a6c50711


[SPARK-20070][SQL] Fix 2.10 build

## What changes were proposed in this pull request?
Commit https://github.com/apache/spark/commit/91fa80fe8a2480d64c430bd10f97b3d44c007bcc broke the build for scala 2.10. The commit uses `Regex.regex` field which is not available in Scala 2.10. This PR fixes this.

## How was this patch tested?
Existing tests.

Author: Herman van Hovell <hv...@databricks.com>

Closes #17420 from hvanhovell/SPARK-20070-2.0.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/0a6c5071
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/0a6c5071
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/0a6c5071

Branch: refs/heads/master
Commit: 0a6c50711b871dce1a04f5dc7652a0b936369fa0
Parents: f88f56b
Author: Herman van Hovell <hv...@databricks.com>
Authored: Sat Mar 25 01:07:50 2017 +0100
Committer: Reynold Xin <rx...@databricks.com>
Committed: Sat Mar 25 01:07:50 2017 +0100

----------------------------------------------------------------------
 .../scala/org/apache/spark/internal/config/ConfigBuilder.scala   | 2 +-
 .../org/apache/spark/internal/config/ConfigEntrySuite.scala      | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/0a6c5071/core/src/main/scala/org/apache/spark/internal/config/ConfigBuilder.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/org/apache/spark/internal/config/ConfigBuilder.scala b/core/src/main/scala/org/apache/spark/internal/config/ConfigBuilder.scala
index d87619a..b992113 100644
--- a/core/src/main/scala/org/apache/spark/internal/config/ConfigBuilder.scala
+++ b/core/src/main/scala/org/apache/spark/internal/config/ConfigBuilder.scala
@@ -225,6 +225,6 @@ private[spark] case class ConfigBuilder(key: String) {
   }
 
   def regexConf: TypedConfigBuilder[Regex] = {
-    new TypedConfigBuilder(this, regexFromString(_, this.key), _.regex)
+    new TypedConfigBuilder(this, regexFromString(_, this.key), _.toString)
   }
 }

http://git-wip-us.apache.org/repos/asf/spark/blob/0a6c5071/core/src/test/scala/org/apache/spark/internal/config/ConfigEntrySuite.scala
----------------------------------------------------------------------
diff --git a/core/src/test/scala/org/apache/spark/internal/config/ConfigEntrySuite.scala b/core/src/test/scala/org/apache/spark/internal/config/ConfigEntrySuite.scala
index f3756b2..3ff7e84 100644
--- a/core/src/test/scala/org/apache/spark/internal/config/ConfigEntrySuite.scala
+++ b/core/src/test/scala/org/apache/spark/internal/config/ConfigEntrySuite.scala
@@ -100,10 +100,10 @@ class ConfigEntrySuite extends SparkFunSuite {
     val rConf = ConfigBuilder(testKey("regex")).regexConf.createWithDefault(".*".r)
 
     conf.set(rConf, "[0-9a-f]{8}".r)
-    assert(conf.get(rConf).regex === "[0-9a-f]{8}")
+    assert(conf.get(rConf).toString === "[0-9a-f]{8}")
 
     conf.set(rConf.key, "[0-9a-f]{4}")
-    assert(conf.get(rConf).regex === "[0-9a-f]{4}")
+    assert(conf.get(rConf).toString === "[0-9a-f]{4}")
 
     conf.set(rConf.key, "[.")
     val e = intercept[IllegalArgumentException](conf.get(rConf))


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org