Skip to content

Commit 93cacba

Browse files
committed
address comments
1 parent 414457c commit 93cacba

File tree

2 files changed

+19
-20
lines changed

2 files changed

+19
-20
lines changed

sql/core/src/main/scala/org/apache/spark/sql/execution/SparkPlanInfo.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import org.apache.spark.sql.execution.metric.SQLMetricInfo
2828
* Stores information about a SQL SparkPlan.
2929
*/
3030
@DeveloperApi
31-
@JsonIgnoreProperties(Array("metadata")) // The metadata filed was removed in Spark 2.3.
31+
@JsonIgnoreProperties(Array("metadata")) // The metadata field was removed in Spark 2.3.
3232
class SparkPlanInfo(
3333
val nodeName: String,
3434
val simpleString: String,

sql/core/src/test/scala/org/apache/spark/sql/execution/SQLJsonProtocolSuite.scala

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,27 @@ import org.apache.spark.util.JsonProtocol
2626
class 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

Comments
 (0)