Skip to content

Commit

Permalink
[SPARK-30719][SQL] Add unit test to verify the log warning print when…
Browse files Browse the repository at this point in the history
… 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>
  • Loading branch information
JkSelf authored and cloud-fan committed Feb 10, 2020
1 parent 70e545a commit 5a24060
Showing 1 changed file with 15 additions and 0 deletions.
Expand Up @@ -789,4 +789,19 @@ class AdaptiveQueryExecSuite
assert(plan.isInstanceOf[AdaptiveSparkPlanExec])
}
}

test("SPARK-30719: do not log warning if intentionally skip AQE") {
val testAppender = new LogAppender("aqe logging warning test when skip")
withLogAppender(testAppender) {
withSQLConf(
SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "true") {
val plan = sql("SELECT * FROM testData").queryExecution.executedPlan
assert(!plan.isInstanceOf[AdaptiveSparkPlanExec])
}
}
assert(!testAppender.loggingEvents
.exists(msg => msg.getRenderedMessage.contains(
s"${SQLConf.ADAPTIVE_EXECUTION_ENABLED.key} is" +
s" enabled but is not supported for")))
}
}

0 comments on commit 5a24060

Please sign in to comment.