cloud-fan commented on code in PR #39037:
URL: https://github.com/apache/spark/pull/39037#discussion_r1067691706
##########
sql/core/src/test/scala/org/apache/spark/sql/execution/adaptive/AdaptiveQueryExecSuite.scala:
##########
@@ -2693,6 +2694,21 @@ class AdaptiveQueryExecSuite
assert(df.rdd.getNumPartitions == 3)
}
}
+
+ test("SPARK-41214: Fix AQE cache does not update plan and metrics") {
+ withSQLConf(SQLConf.CAN_CHANGE_CACHED_PLAN_OUTPUT_PARTITIONING.key ->
"true") {
+ val arr = Seq(
+ (1, "Employee_1", "Department_1"),
+ (2, "Employee_2", "Department_2"))
+ val df = arr.toDF("id", "name", "department").filter($"id" <
3).groupBy($"name").count()
+ df.cache().createOrReplaceTempView("v1")
+ val arr2 = Seq((1, "Employee_1", "Department_1"))
+ val df2 = arr2.toDF("id", "name", "department").filter($"id" >
0).groupBy($"name").count()
+ df2.cache().createOrReplaceTempView("v2")
+
+ runAdaptiveAndVerifyResult("SELECT * FROM v1 JOIN v2 on v1.name =
v2.name")
Review Comment:
does this test check metrics?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]