Github user hvanhovell commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14548#discussion_r74228083
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkPlan.scala ---
    @@ -165,21 +161,10 @@ abstract class SparkPlan extends QueryPlan[SparkPlan] 
with Logging with Serializ
        */
       protected def waitForSubqueries(): Unit = synchronized {
         // fill in the result of subqueries
    -    subqueryResults.foreach { case (e, futureResult) =>
    -      val rows = ThreadUtils.awaitResult(futureResult, Duration.Inf)
    -      if (rows.length > 1) {
    -        sys.error(s"more than one row returned by a subquery used as an 
expression:\n${e.plan}")
    -      }
    -      if (rows.length == 1) {
    -        assert(rows(0).numFields == 1,
    -          s"Expects 1 field, but got ${rows(0).numFields}; something went 
wrong in analysis")
    -        e.updateResult(rows(0).get(0, e.dataType))
    -      } else {
    -        // If there is no rows returned, the result should be null.
    -        e.updateResult(null)
    -      }
    +    runningSubqueries.foreach { sub =>
    +      sub.updateResult(sub.plan.executeCollect())
    --- End diff --
    
    The subplan is `SubqueryExec` right? Why not create a method in 
`ExecSubqueryExpression` for this?



---
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]

Reply via email to