File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
main/scala/org/apache/spark/sql/hive
test/scala/org/apache/spark/sql/hive/execution Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -284,7 +284,7 @@ class HiveContext(sc: SparkContext) extends SQLContext(sc) {
284
284
* Execute the command using Hive and return the results as a sequence. Each element
285
285
* in the sequence is one row.
286
286
*/
287
- protected def runHive (cmd : String , maxRows : Int = 1000 ): Seq [String ] = {
287
+ protected def runHive (cmd : String , maxRows : Int = 1000 ): Seq [String ] = synchronized {
288
288
try {
289
289
val cmd_trimmed : String = cmd.trim()
290
290
val tokens : Array [String ] = cmd_trimmed.split(" \\ s+" )
Original file line number Diff line number Diff line change @@ -56,6 +56,13 @@ class HiveQuerySuite extends HiveComparisonTest with BeforeAndAfter {
56
56
Locale .setDefault(originalLocale)
57
57
}
58
58
59
+ test(" SPARK-4908: concurent hive native commands" ) {
60
+ (1 to 100 ).par.map { _ =>
61
+ sql(" USE default" )
62
+ sql(" SHOW TABLES" )
63
+ }
64
+ }
65
+
59
66
createQueryTest(" constant object inspector for generic udf" ,
60
67
""" SELECT named_struct(
61
68
lower("AA"), "10",
You can’t perform that action at this time.
0 commit comments