Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
address comments
  • Loading branch information
cloud-fan committed Sep 15, 2017
commit 93cacbabfe72a1c7dba20d00612757ae6e11f854
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import org.apache.spark.sql.execution.metric.SQLMetricInfo
* Stores information about a SQL SparkPlan.
*/
@DeveloperApi
@JsonIgnoreProperties(Array("metadata")) // The metadata filed was removed in Spark 2.3.
@JsonIgnoreProperties(Array("metadata")) // The metadata field was removed in Spark 2.3.
class SparkPlanInfo(
val nodeName: String,
val simpleString: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,27 @@ import org.apache.spark.util.JsonProtocol
class SQLJsonProtocolSuite extends SparkFunSuite {

test("SparkPlanGraph backward compatibility: metadata") {
val SQLExecutionStartJsonString =
"""
|{
| "Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionStart",
| "executionId":0,
| "description":"test desc",
| "details":"test detail",
| "physicalPlanDescription":"test plan",
| "sparkPlanInfo": {
| "nodeName":"TestNode",
| "simpleString":"test string",
| "children":[],
| "metadata":{},
| "metrics":[]
| },
| "time":0
|}
""".stripMargin
val reconstructedEvent = JsonProtocol.sparkEventFromJson(parse(SQLExecutionStartJsonString))
val expectedEvent = SparkListenerSQLExecutionStart(0, "test desc", "test detail", "test plan",
new SparkPlanInfo("TestNode", "test string", Nil, Nil), 0)
assert(reconstructedEvent == expectedEvent)
}

private val SQLExecutionStartJsonString =
"""
|{
| "Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionStart",
| "executionId":0,
| "description":"test desc",
| "details":"test detail",
| "physicalPlanDescription":"test plan",
| "sparkPlanInfo": {
| "nodeName":"TestNode",
| "simpleString":"test string",
| "children":[],
| "metadata":{},
| "metrics":[]
| },
| "time":0
|}
""".stripMargin
}