aboutsummaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorAndrew Or <andrew@databricks.com>2016-03-09 17:34:28 -0800
committerShixiong Zhu <shixiong@databricks.com>2016-03-09 17:34:28 -0800
commit37fcda3e6cf1707fb7a348a4d47231849ef8abf6 (patch)
treef24a199e92660428a36988e43301ceffe5c57b16 /sql
parentdbf2a7cfad067d2c553d8b8831e04aace12fcee1 (diff)
downloadspark-37fcda3e6cf1707fb7a348a4d47231849ef8abf6.tar.gz
spark-37fcda3e6cf1707fb7a348a4d47231849ef8abf6.tar.bz2
spark-37fcda3e6cf1707fb7a348a4d47231849ef8abf6.zip
[SPARK-13747][SQL] Fix concurrent query with fork-join pool
## What changes were proposed in this pull request? Fix this use case, which was already fixed in SPARK-10548 in 1.6 but was broken in master due to #9264: ``` (1 to 100).par.foreach { _ => sc.parallelize(1 to 5).map { i => (i, i) }.toDF("a", "b").count() } ``` This threw `IllegalArgumentException` consistently before this patch. For more detail, see the JIRA. ## How was this patch tested? New test in `SQLExecutionSuite`. Author: Andrew Or <andrew@databricks.com> Closes #11586 from andrewor14/fix-concurrent-sql.
Diffstat (limited to 'sql')
-rw-r--r--sql/core/src/test/scala/org/apache/spark/sql/execution/SQLExecutionSuite.scala14
1 files changed, 14 insertions, 0 deletions
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/SQLExecutionSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/SQLExecutionSuite.scala
index 824d89e3b2..c9f517ca34 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/execution/SQLExecutionSuite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/SQLExecutionSuite.scala
@@ -49,6 +49,20 @@ class SQLExecutionSuite extends SparkFunSuite {
}
}
+ test("concurrent query execution with fork-join pool (SPARK-13747)") {
+ val sc = new SparkContext("local[*]", "test")
+ val sqlContext = new SQLContext(sc)
+ import sqlContext.implicits._
+ try {
+ // Should not throw IllegalArgumentException
+ (1 to 100).par.foreach { _ =>
+ sc.parallelize(1 to 5).map { i => (i, i) }.toDF("a", "b").count()
+ }
+ } finally {
+ sc.stop()
+ }
+ }
+
/**
* Trigger SPARK-10548 by mocking a parent and its child thread executing queries concurrently.
*/