Skip to content

Commit 0f00d86

Browse files
Add a test for singleton set command in SQL.
1 parent 41acd75 commit 0f00d86

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,16 @@ class SQLConfSuite extends QueryTest {
7070
conf.clear()
7171
}
7272

73+
test("set itself returns all config variables currently specified in Hive or SQLConf") {
74+
assert(sql("set").collect() === Seq(""))
75+
76+
sql(s"SET $testKey=$testVal")
77+
assert(sql("set").collect() === Seq(s"$testKey=$testVal"))
78+
79+
sql(s"SET ${testKey + testKey}=${testVal + testVal}")
80+
// TODO: should this be 1-elem Seq or 2-elem?
81+
assert(sql("set").collect() ===
82+
Seq(s"$testKey=$testVal\n${testKey + testKey}=${testVal + testVal}"))
83+
}
84+
7385
}

0 commit comments

Comments
 (0)