sarutak commented on a change in pull request #25274: [SPARK-28537][SQL] 
DebugExec cannot debug broadcast or columnar related queries.
URL: https://github.com/apache/spark/pull/25274#discussion_r310393798
 
 

 ##########
 File path: 
sql/core/src/test/scala/org/apache/spark/sql/execution/debug/DebuggingSuite.scala
 ##########
 @@ -48,4 +52,44 @@ class DebuggingSuite extends SparkFunSuite with 
SharedSQLContext {
     assert(res.forall{ case (subtree, code) =>
       subtree.contains("Range") && code.contains("Object[]")})
   }
+
+  test("SPARK-28537: DebugExec cannot debug broadcast related queries") {
+    val rightDF = spark.range(10)
+    val leftDF = spark.range(10)
+    val joinedDF = leftDF.join(rightDF, leftDF("id") === rightDF("id"))
+
+    val captured = new ByteArrayOutputStream()
+    Console.withOut(captured) {
+      joinedDF.debug()
+    }
+
+    val output = captured.toString()
+    assert(output.contains(
+      """== BroadcastExchange HashedRelationBroadcastMode(List(input[0, 
bigint, false])) ==
+      |Tuples output: 0
+      | id LongType: {}
+      |== WholeStageCodegen ==
+      |Tuples output: 10
+      | id LongType: {java.lang.Long}
+      |== Range (0, 10, step=1, splits=2) ==
+      |Tuples output: 0
+      | id LongType: {}""".stripMargin))
+  }
+
+  test("SPARK-28537: DebugExec cannot debug columnar related queries") {
+    val df = spark.range(5)
+    df.persist()
+
+    val captured = new ByteArrayOutputStream()
+    Console.withOut(captured) {
+      df.debug()
+    }
+
+    val output = captured.toString()replaceAll ("#\\d+", "#x")
 
 Review comment:
   Thanks! What an embarrassing mistake...

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to