Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Handle cases where SET returns Rows of (single) strings
  • Loading branch information
willb committed Sep 2, 2014
commit 6525d8ef79645abe3ed26e4e2ac6aa09bcd0b203
Original file line number Diff line number Diff line change
Expand Up @@ -520,9 +520,14 @@ class HiveQuerySuite extends HiveComparisonTest {
val testKey = "spark.sql.key.usedfortestonly"
val testVal = "test.val.0"
val nonexistentKey = "nonexistent"
def collectResults(rdd: SchemaRDD): Set[(String, String)] =
rdd.collect().map { case Row(key: String, value: String) => key -> value }.toSet

val KV = "([^=]+)=([^=]*)".r
def collectResults(rdd: SchemaRDD): Set[(String, String)] =
rdd.collect().map {
case Row(key: String, value: String) => key -> value
case Row(kv: String) => kv match {
case KV(key, value) => key -> value
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor style nit: this could just be: case Row(KV(key,value)) => ... I believe.

}
}.toSet
clear()

// "set" itself returns all config variables currently specified in SQLConf.
Expand Down