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) {
284284 * Execute the command using Hive and return the results as a sequence. Each element
285285 * in the sequence is one row.
286286 */
287- protected def runHive (cmd : String , maxRows : Int = 1000 ): Seq [String ] = {
287+ protected def runHive (cmd : String , maxRows : Int = 1000 ): Seq [String ] = synchronized {
288288 try {
289289 val cmd_trimmed : String = cmd.trim()
290290 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 {
5656 Locale .setDefault(originalLocale)
5757 }
5858
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+
5966 createQueryTest(" constant object inspector for generic udf" ,
6067 """ SELECT named_struct(
6168 lower("AA"), "10",
You can’t perform that action at this time.
0 commit comments