Github user hvanhovell commented on a diff in the pull request:
https://github.com/apache/spark/pull/14548#discussion_r74226982
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkPlan.scala ---
@@ -142,21 +142,17 @@ abstract class SparkPlan extends QueryPlan[SparkPlan]
with Logging with Serializ
* This list is populated by [[prepareSubqueries]], which is called in
[[prepare]].
*/
@transient
- private val subqueryResults = new ArrayBuffer[(ScalarSubquery,
Future[Array[InternalRow]])]
+ private val runningSubqueries = new ArrayBuffer[ExecSubqueryExpression]
/**
* Finds scalar subquery expressions in this plan node and starts
evaluating them.
- * The list of subqueries are added to [[subqueryResults]].
*/
protected def prepareSubqueries(): Unit = {
- val allSubqueries = expressions.flatMap(_.collect {case e:
ScalarSubquery => e})
- allSubqueries.asInstanceOf[Seq[ScalarSubquery]].foreach { e =>
- val futureResult = Future {
- // Each subquery should return only one row (and one column). We
take two here and throws
- // an exception later if the number of rows is greater than one.
- e.executedPlan.executeTake(2)
- }(SparkPlan.subqueryExecutionContext)
- subqueryResults += e -> futureResult
+ val allSubqueries = expressions.flatMap(_.collect { case e:
ExecSubqueryExpression => e })
--- End diff --
Why not combine this with the `foreach` below?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]