@@ -26,28 +26,27 @@ import org.apache.spark.util.JsonProtocol
2626class SQLJsonProtocolSuite extends SparkFunSuite {
2727
2828 test(" SparkPlanGraph backward compatibility: metadata" ) {
29+ val SQLExecutionStartJsonString =
30+ """
31+ |{
32+ | "Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionStart",
33+ | "executionId":0,
34+ | "description":"test desc",
35+ | "details":"test detail",
36+ | "physicalPlanDescription":"test plan",
37+ | "sparkPlanInfo": {
38+ | "nodeName":"TestNode",
39+ | "simpleString":"test string",
40+ | "children":[],
41+ | "metadata":{},
42+ | "metrics":[]
43+ | },
44+ | "time":0
45+ |}
46+ """ .stripMargin
2947 val reconstructedEvent = JsonProtocol .sparkEventFromJson(parse(SQLExecutionStartJsonString ))
3048 val expectedEvent = SparkListenerSQLExecutionStart (0 , " test desc" , " test detail" , " test plan" ,
3149 new SparkPlanInfo (" TestNode" , " test string" , Nil , Nil ), 0 )
3250 assert(reconstructedEvent == expectedEvent)
3351 }
34-
35- private val SQLExecutionStartJsonString =
36- """
37- |{
38- | "Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionStart",
39- | "executionId":0,
40- | "description":"test desc",
41- | "details":"test detail",
42- | "physicalPlanDescription":"test plan",
43- | "sparkPlanInfo": {
44- | "nodeName":"TestNode",
45- | "simpleString":"test string",
46- | "children":[],
47- | "metadata":{},
48- | "metrics":[]
49- | },
50- | "time":0
51- |}
52- """ .stripMargin
5352}
0 commit comments