@@ -416,10 +416,10 @@ class HiveQuerySuite extends HiveComparisonTest {
416416 hql(s " set $testKey= $testVal" )
417417 assert(get(testKey, testVal + " _" ) == testVal)
418418
419- hql(" set mapred.reduce.tasks =20" )
420- assert(get(" mapred.reduce.tasks " , " 0" ) == " 20" )
421- hql(" set mapred.reduce.tasks = 40" )
422- assert(get(" mapred.reduce.tasks " , " 0" ) == " 40" )
419+ hql(" set some.property =20" )
420+ assert(get(" some.property " , " 0" ) == " 20" )
421+ hql(" set some.property = 40" )
422+ assert(get(" some.property " , " 0" ) == " 40" )
423423
424424 hql(s " set $testKey= $testVal" )
425425 assert(get(testKey, " 0" ) == testVal)
@@ -433,63 +433,61 @@ class HiveQuerySuite extends HiveComparisonTest {
433433 val testKey = " spark.sql.key.usedfortestonly"
434434 val testVal = " test.val.0"
435435 val nonexistentKey = " nonexistent"
436- def collectResults (rdd : SchemaRDD ): Set [(String , String )] =
437- rdd.collect().map { case Row (key : String , value : String ) => key -> value }.toSet
438436
439437 clear()
440438
441439 // "set" itself returns all config variables currently specified in SQLConf.
442440 assert(hql(" SET" ).collect().size == 0 )
443441
444- assertResult(Set ( testKey -> testVal)) {
445- collectResults( hql(s " SET $testKey= $testVal" ))
442+ assertResult(Array ( s " $ testKey= $ testVal" )) {
443+ hql(s " SET $testKey= $testVal" ).collect().map(_.getString( 0 ))
446444 }
447445
448446 assert(hiveconf.get(testKey, " " ) == testVal)
449- assertResult(Set ( testKey -> testVal)) {
450- collectResults( hql(" SET" ))
447+ assertResult(Array ( s " $ testKey= $ testVal" )) {
448+ hql(s " SET $testKey = $testVal " ).collect().map(_.getString( 0 ))
451449 }
452450
453451 hql(s " SET ${testKey + testKey}= ${testVal + testVal}" )
454452 assert(hiveconf.get(testKey + testKey, " " ) == testVal + testVal)
455- assertResult(Set ( testKey -> testVal, ( testKey + testKey) -> ( testVal + testVal) )) {
456- collectResults( hql(" SET" ))
453+ assertResult(Array ( s " $ testKey= $ testVal" , s " ${ testKey + testKey} = ${ testVal + testVal} " )) {
454+ hql(s " SET " ).collect().map(_.getString( 0 ))
457455 }
458456
459457 // "set key"
460- assertResult(Set ( testKey -> testVal)) {
461- collectResults( hql(s " SET $testKey" ))
458+ assertResult(Array ( s " $ testKey= $ testVal" )) {
459+ hql(s " SET $testKey" ).collect().map(_.getString( 0 ))
462460 }
463461
464- assertResult(Set (nonexistentKey -> " <undefined>" )) {
465- collectResults( hql(s " SET $nonexistentKey" ))
462+ assertResult(Array ( s " $nonexistentKey = <undefined>" )) {
463+ hql(s " SET $nonexistentKey" ).collect().map(_.getString( 0 ))
466464 }
467465
468466 // Assert that sql() should have the same effects as hql() by repeating the above using sql().
469467 clear()
470468 assert(sql(" SET" ).collect().size == 0 )
471469
472- assertResult(Set ( testKey -> testVal)) {
473- collectResults( sql(s " SET $testKey= $testVal" ))
470+ assertResult(Array ( s " $ testKey= $ testVal" )) {
471+ sql(s " SET $testKey= $testVal" ).collect().map(_.getString( 0 ))
474472 }
475473
476474 assert(hiveconf.get(testKey, " " ) == testVal)
477- assertResult(Set ( testKey -> testVal)) {
478- collectResults( sql(" SET" ))
475+ assertResult(Array ( s " $ testKey= $ testVal" )) {
476+ sql(" SET" ).collect().map(_.getString( 0 ))
479477 }
480478
481479 sql(s " SET ${testKey + testKey}= ${testVal + testVal}" )
482480 assert(hiveconf.get(testKey + testKey, " " ) == testVal + testVal)
483- assertResult(Set ( testKey -> testVal, ( testKey + testKey) -> ( testVal + testVal) )) {
484- collectResults( sql(" SET" ))
481+ assertResult(Array ( s " $ testKey= $ testVal" , s " ${ testKey + testKey} = ${ testVal + testVal} " )) {
482+ sql(" SET" ).collect().map(_.getString( 0 ))
485483 }
486484
487- assertResult(Set ( testKey -> testVal)) {
488- collectResults( sql(s " SET $testKey" ))
485+ assertResult(Array ( s " $ testKey= $ testVal" )) {
486+ sql(s " SET $testKey" ).collect().map(_.getString( 0 ))
489487 }
490488
491- assertResult(Set (nonexistentKey -> " <undefined>" )) {
492- collectResults( sql(s " SET $nonexistentKey" ))
489+ assertResult(Array ( s " $nonexistentKey = <undefined>" )) {
490+ sql(s " SET $nonexistentKey" ).collect().map(_.getString( 0 ))
493491 }
494492
495493 clear()
0 commit comments