Skip to content

Commit

Permalink
Add a test for hql() in HiveQuerySuite.
Browse files Browse the repository at this point in the history
  • Loading branch information
concretevitamin committed Jun 4, 2014
1 parent 2276929 commit 41acd75
Showing 1 changed file with 24 additions and 0 deletions.
Expand Up @@ -157,4 +157,28 @@ class HiveQuerySuite extends HiveComparisonTest {
hql("SHOW TABLES").toString
hql("SELECT * FROM src").toString
}

test("parse HQL set commands") {
// Adapted from SQLConfSuite.
sqlConf.clear()
val testKey = "spark.sql.key"
val testVal = "val0,val_1,val2.3,my_table"

hql(s"set $testKey=$testVal")
assert(sqlConf.get(testKey, testVal + "_") == testVal)

hql("set mapred.reduce.tasks=20")
assert(sqlConf.get("mapred.reduce.tasks", "0") == "20")
hql("set mapred.reduce.tasks = 40")
assert(sqlConf.get("mapred.reduce.tasks", "0") == "40")

hql(s"set $testKey=$testVal")
assert(sqlConf.get(testKey, "0") == testVal)

hql(s"set$testKey=")
assert(sqlConf.get(testKey, "0") == "")

sqlConf.clear()
}

}

0 comments on commit 41acd75

Please sign in to comment.