Skip to content

Commit 5a24060

Browse files
JkSelfcloud-fan
authored andcommitted
[SPARK-30719][SQL] Add unit test to verify the log warning print when intentionally skip AQE
### What changes were proposed in this pull request? This is a follow up in [#27452](#27452). Add a unit test to verify whether the log warning is print when intentionally skip AQE. ### Why are the changes needed? Add unit test ### Does this PR introduce any user-facing change? No ### How was this patch tested? adding unit test Closes #27515 from JkSelf/aqeLoggingWarningTest. Authored-by: jiake <ke.a.jia@intel.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com>
1 parent 70e545a commit 5a24060

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

sql/core/src/test/scala/org/apache/spark/sql/execution/adaptive/AdaptiveQueryExecSuite.scala

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,4 +789,19 @@ class AdaptiveQueryExecSuite
789789
assert(plan.isInstanceOf[AdaptiveSparkPlanExec])
790790
}
791791
}
792+
793+
test("SPARK-30719: do not log warning if intentionally skip AQE") {
794+
val testAppender = new LogAppender("aqe logging warning test when skip")
795+
withLogAppender(testAppender) {
796+
withSQLConf(
797+
SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "true") {
798+
val plan = sql("SELECT * FROM testData").queryExecution.executedPlan
799+
assert(!plan.isInstanceOf[AdaptiveSparkPlanExec])
800+
}
801+
}
802+
assert(!testAppender.loggingEvents
803+
.exists(msg => msg.getRenderedMessage.contains(
804+
s"${SQLConf.ADAPTIVE_EXECUTION_ENABLED.key} is" +
805+
s" enabled but is not supported for")))
806+
}
792807
}

0 commit comments

Comments
 (0)