Skip to content

[SPARK-14356] Update spark.sql.execution.debug to work on Datasets #12140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ package object debug {
}

/**
* Augments [[DataFrame]]s with debug methods.
* Augments [[Dataset]]s with debug methods.
*/
implicit class DebugQuery(query: DataFrame) extends Logging {
implicit class DebugQuery(query: Dataset[_]) extends Logging {
def debug(): Unit = {
val plan = query.queryExecution.executedPlan
val visited = new collection.mutable.HashSet[TreeNodeRef]()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,19 @@ package org.apache.spark.sql.execution.debug

import org.apache.spark.SparkFunSuite
import org.apache.spark.sql.test.SharedSQLContext
import org.apache.spark.sql.test.SQLTestData.TestData

class DebuggingSuite extends SparkFunSuite with SharedSQLContext {

test("DataFrame.debug()") {
testData.debug()
}

test("Dataset.debug()") {
import testImplicits._
testData.as[TestData].debug()
}

test("debugCodegen") {
val res = codegenString(sqlContext.range(10).groupBy("id").count().queryExecution.executedPlan)
assert(res.contains("Subtree 1 / 2"))
Expand Down