File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed
core/src/main/scala/org/apache/spark/sql/execution
hive/src/test/scala/org/apache/spark/sql/hive/execution Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ case class SetCommand(
4848 // Set value for key k.
4949 case (Some (k), Some (v)) =>
5050 context.set(k, v)
51- Array .empty[( String , String )]
51+ Array (k -> v)
5252
5353 // Query the value bound to key k.
5454 case (Some (k), _) =>
Original file line number Diff line number Diff line change @@ -250,10 +250,12 @@ class HiveQuerySuite extends HiveComparisonTest {
250250 clear()
251251
252252 // "set" itself returns all config variables currently specified in SQLConf.
253- assert(hql(" set" ).collect().size == 0 )
253+ assert(hql(" SET" ).collect().size == 0 )
254+
255+ assertResult(Array (testKey -> testVal)) {
256+ rowsToPairs(hql(s " SET $testKey= $testVal" ).collect())
257+ }
254258
255- // "set key=val"
256- hql(s " SET $testKey= $testVal" )
257259 assert(hiveconf.get(testKey, " " ) == testVal)
258260 assertResult(Array (testKey -> testVal)) {
259261 rowsToPairs(hql(" SET" ).collect())
@@ -278,7 +280,10 @@ class HiveQuerySuite extends HiveComparisonTest {
278280 clear()
279281 assert(sql(" SET" ).collect().size == 0 )
280282
281- sql(s " SET $testKey= $testVal" )
283+ assertResult(Array (testKey -> testVal)) {
284+ rowsToPairs(sql(s " SET $testKey= $testVal" ).collect())
285+ }
286+
282287 assert(hiveconf.get(testKey, " " ) == testVal)
283288 assertResult(Array (testKey -> testVal)) {
284289 rowsToPairs(sql(" SET" ).collect())
You can’t perform that action at this time.
0 commit comments