Skip to content
Snippets Groups Projects
Commit 0a6c5071 authored by Herman van Hovell's avatar Herman van Hovell Committed by Reynold Xin
Browse files

[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 <hvanhovell@databricks.com>

Closes #17420 from hvanhovell/SPARK-20070-2.0.
parent f88f56b8
No related branches found
No related tags found
No related merge requests found
...@@ -225,6 +225,6 @@ private[spark] case class ConfigBuilder(key: String) { ...@@ -225,6 +225,6 @@ private[spark] case class ConfigBuilder(key: String) {
} }
def regexConf: TypedConfigBuilder[Regex] = { def regexConf: TypedConfigBuilder[Regex] = {
new TypedConfigBuilder(this, regexFromString(_, this.key), _.regex) new TypedConfigBuilder(this, regexFromString(_, this.key), _.toString)
} }
} }
...@@ -100,10 +100,10 @@ class ConfigEntrySuite extends SparkFunSuite { ...@@ -100,10 +100,10 @@ class ConfigEntrySuite extends SparkFunSuite {
val rConf = ConfigBuilder(testKey("regex")).regexConf.createWithDefault(".*".r) val rConf = ConfigBuilder(testKey("regex")).regexConf.createWithDefault(".*".r)
conf.set(rConf, "[0-9a-f]{8}".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}") 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, "[.") conf.set(rConf.key, "[.")
val e = intercept[IllegalArgumentException](conf.get(rConf)) val e = intercept[IllegalArgumentException](conf.get(rConf))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment