[SPARK-20070][SQL] Fix 2.10 build
## What changes were proposed in this pull request?
Commit 91fa80fe8a
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.
This commit is contained in:
parent
f88f56b835
commit
0a6c50711b
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Reference in a new issue