Skip to content

Commit 0340fa6

Browse files
committed
add UT
1 parent 182eb79 commit 0340fa6

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class SQLJsonProtocolSuite extends SparkFunSuite {
4646
""".stripMargin
4747
val reconstructedEvent = JsonProtocol.sparkEventFromJson(parse(SQLExecutionStartJsonString))
4848
val expectedEvent = SparkListenerSQLExecutionStart(0, "test desc", "test detail", "test plan",
49-
new SparkPlanInfo("TestNode", "test string", Nil, Nil), 0)
49+
new SparkPlanInfo("TestNode", "test string", Nil, Map(), Nil), 0)
5050
assert(reconstructedEvent == expectedEvent)
5151
}
5252
}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,12 @@ class SparkPlanSuite extends QueryTest with SharedSQLContext {
5050
}
5151
}
5252
}
53+
54+
test("SPARK-25357 SparkPlanInfo of FileScan contains nonEmpty metadata") {
55+
withTempPath { path =>
56+
spark.range(5).write.parquet(path.getAbsolutePath)
57+
val f = spark.read.parquet(path.getAbsolutePath)
58+
assert(SparkPlanInfo.fromSparkPlan(f.queryExecution.sparkPlan).metadata.nonEmpty)
59+
}
60+
}
5361
}

0 commit comments

Comments
 (0)