You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/04/14 17:23:38 UTC
[GitHub] [spark] sririshindra commented on a change in pull request #28173:
[SPARK-31389][SQL][TESTS] Ensure all tests in SQLMetricsSuite run with both
codegen on and off
sririshindra commented on a change in pull request #28173: [SPARK-31389][SQL][TESTS] Ensure all tests in SQLMetricsSuite run with both codegen on and off
URL: https://github.com/apache/spark/pull/28173#discussion_r408307690
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/metric/SQLMetricsTestUtils.scala
##########
@@ -214,14 +214,16 @@ trait SQLMetricsTestUtils extends SQLTestUtils {
protected def testSparkPlanMetrics(
df: DataFrame,
expectedNumOfJobs: Int,
- expectedMetrics: Map[Long, (String, Map[String, Any])]): Unit = {
+ expectedMetrics: Map[Long, (String, Map[String, Any])],
+ enableWholeStage: Boolean = false): Unit = {
val expectedMetricsPredicates = expectedMetrics.mapValues { case (nodeName, nodeMetrics) =>
(nodeName, nodeMetrics.mapValues(expectedMetricValue =>
(actualMetricValue: Any) => {
actualMetricValue.toString.matches(expectedMetricValue.toString)
}))
}
- testSparkPlanMetricsWithPredicates(df, expectedNumOfJobs, expectedMetricsPredicates)
+ testSparkPlanMetricsWithPredicates(df, expectedNumOfJobs, expectedMetricsPredicates,
Review comment:
@maropu
The expectedMetricsPredicates can vary with codegenEnabled=true and codegenEnabled=false.
Also the test "WholeStageCodegen metrics" needs to run testSparkPlanMetricsWithPredicates method with only codegenEnabled=true. So if we change the method to run with both configurations then the test "WholeStageCodegen metrics" will fail.
The dataframe (variable df) needs to fresh for every call of testSparkPlanMetricsWithPredicates. The dataframe should not be reused or else the metrics will change causing the tests to fail.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org