Skip to content

Commit 2276929

Browse files
Fix default hive result for set commands in HiveComparisonTest.
1 parent 3b0c71b commit 2276929

File tree

3 files changed

+2
-2
lines changed

3 files changed

+2
-2
lines changed

sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ class SQLContext(@transient val sparkContext: SparkContext)
282282
logical match {
283283
case SetCommand(key, value) =>
284284
sqlConf.set(key, value)
285-
emptyResult // TODO: should this return something else?
285+
emptyResult // TODO: should this return something else? Single row consisting of one 0?
286286
case _ => executedPlan.execute()
287287
}
288288
}

sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveContext.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,6 @@ class HiveContext(sc: SparkContext) extends SQLContext(sc) {
258258

259259
analyzed match {
260260
case SetCommand(key, value) =>
261-
logger.debug("inside Hive's toRdd -- matched SetCommand")
262261
// Record the set command inside SQLConf, as well as have Hive execute it.
263262
sqlConf.set(key, value)
264263
processCmd(s"set $key=$value")

sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveComparisonTest.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ abstract class HiveComparisonTest
138138

139139
val orderedAnswer = hiveQuery.logical match {
140140
// Clean out non-deterministic time schema info.
141+
case _: SetCommand => Seq("0")
141142
case _: NativeCommand => answer.filterNot(nonDeterministicLine).filterNot(_ == "")
142143
case _: ExplainCommand => answer
143144
case plan => if (isSorted(plan)) answer else answer.sorted

0 commit comments

Comments
 (0)