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

    https://github.com/apache/spark/pull/21754#discussion_r207101662
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/exchange/Exchange.scala 
---
    @@ -52,6 +52,14 @@ case class ReusedExchangeExec(override val output: 
Seq[Attribute], child: Exchan
       // Ignore this wrapper for canonicalizing.
       override def doCanonicalize(): SparkPlan = child.canonicalized
     
    +  override protected def doPrepare(): Unit = {
    +    child match {
    +      case shuffleExchange @ ShuffleExchangeExec(_, _, Some(coordinator)) 
=>
    +        coordinator.registerExchange(shuffleExchange)
    --- End diff --
    
    The master has the same problem? I checked the query in the master below;
    ```
    
    Welcome to
          ____              __
         / __/__  ___ _____/ /__
        _\ \/ _ \/ _ `/ __/  '_/
       /___/ .__/\_,_/_/ /_/\_\   version 2.4.0-SNAPSHOT
          /_/
    
    Using Scala version 2.11.12 (Java HotSpot(TM) 64-Bit Server VM, Java 
1.8.0_31)
    Type in expressions to have them evaluated.
    Type :help for more information.
    
    scala> sql("SET spark.sql.adaptive.enabled=true")
    scala> sql("SET spark.sql.autoBroadcastJoinThreshold=-1")
    scala> val df = spark.range(1).selectExpr("id AS key", "id AS value")
    scala> val resultDf = df.join(df, "key").join(df, "key")
    scala> resultDf.show
    ...
      at 
org.apache.spark.sql.execution.exchange.ShuffleExchangeExec$$anonfun$doExecute$1.apply(ShuffleExchangeExec.scala:119)
      at 
org.apache.spark.sql.catalyst.errors.package$.attachTree(package.scala:52)
      ... 101 more
    Caused by: java.lang.AssertionError: assertion failed
      at scala.Predef$.assert(Predef.scala:156)
      at 
org.apache.spark.sql.execution.exchange.ExchangeCoordinator.doEstimationIfNecessary(ExchangeCoordinator.scala:201)
      at 
org.apache.spark.sql.execution.exchange.ExchangeCoordinator.postShuffleRDD(ExchangeCoordinator.scala:259)
      at 
org.apache.spark.sql.execution.exchange.ShuffleExchangeExec$$anonfun$doExecute$1.apply(ShuffleExchangeExec.scala:124)
      at 
org.apache.spark.sql.execution.exchange.ShuffleExchangeExec$$anonfun$doExecute$1.apply(ShuffleExchangeExec.scala:119)
      at 
org.apache.spark.sql.catalyst.errors.package$.attachTree(package.scala:52)
    ...
    ```


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to