Skip to content

Commit ce7c6c8

Browse files
committed
Remove seqConf
1 parent f3c1b33 commit ce7c6c8

File tree

2 files changed

+0
-37
lines changed

2 files changed

+0
-37
lines changed

sql/core/src/main/scala/org/apache/spark/sql/SQLConf.scala

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -138,17 +138,6 @@ private[spark] object SQLConf {
138138
doc: String = "",
139139
isPublic: Boolean = true): SQLConfEntry[String] =
140140
SQLConfEntry(key, defaultValue, v => v, v => v, doc, isPublic)
141-
142-
def seqConf[T](
143-
key: String,
144-
valueConverter: String => T,
145-
defaultValue: Option[Seq[T]] = None,
146-
doc: String = "",
147-
isPublic: Boolean = true):
148-
SQLConfEntry[Seq[T]] = {
149-
SQLConfEntry(
150-
key, defaultValue, _.split(",").map(valueConverter), _.mkString(","), doc, isPublic)
151-
}
152141
}
153142

154143
import SQLConfEntry._

sql/core/src/test/scala/org/apache/spark/sql/SQLConfEntrySuite.scala

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -132,30 +132,4 @@ class SQLConfEntrySuite extends SparkFunSuite {
132132
assert(conf.getRawConf(key) === "abcde")
133133
assert(conf.getConf(confEntry, "abc") === "abcde")
134134
}
135-
136-
test("seqConf") {
137-
val key = "spark.sql.SQLConfEntrySuite.seq"
138-
val confEntry = SQLConfEntry.seqConf("spark.sql.SQLConfEntrySuite.seq", { v =>
139-
try {
140-
v.toInt
141-
} catch {
142-
case _: NumberFormatException =>
143-
throw new IllegalArgumentException(s"items of $key should be int, but was $v")
144-
}
145-
})
146-
assert(conf.getConf(confEntry, Seq(1, 2, 3)) == Seq(1, 2, 3))
147-
148-
conf.setConf(confEntry, Seq(1, 2, 3, 4))
149-
assert(conf.getConf(confEntry, Seq(1, 2, 3)) === Seq(1, 2, 3, 4))
150-
151-
conf.setRawConf(key, "1,2,3,4,5")
152-
assert(conf.getRawConf(key, "1,2,3") === "1,2,3,4,5")
153-
assert(conf.getRawConf(key) === "1,2,3,4,5")
154-
assert(conf.getConf(confEntry, Seq(1, 2, 3)) === Seq(1, 2, 3, 4, 5))
155-
156-
val e = intercept[IllegalArgumentException] {
157-
conf.setRawConf(key, "a,b,c")
158-
}
159-
assert(e.getMessage === s"items of $key should be int, but was a")
160-
}
161135
}

0 commit comments

Comments
 (0)