cloud-fan commented on a change in pull request #26813: [SPARK-30188][SQL][WIP]
Enable adaptive query execution by default
URL: https://github.com/apache/spark/pull/26813#discussion_r362207621
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/util/DataFrameCallbackSuite.scala
##########
@@ -89,38 +91,46 @@ class DataFrameCallbackSuite extends QueryTest with
SharedSparkSession {
}
test("get numRows metrics by callback") {
- val metrics = ArrayBuffer.empty[Long]
- val listener = new QueryExecutionListener {
- // Only test successful case here, so no need to implement `onFailure`
- override def onFailure(funcName: String, qe: QueryExecution, error:
Throwable): Unit = {}
-
- override def onSuccess(funcName: String, qe: QueryExecution, duration:
Long): Unit = {
- val metric = qe.executedPlan match {
- case w: WholeStageCodegenExec => w.child.longMetric("numOutputRows")
- case other => other.longMetric("numOutputRows")
+ withSQLConf(SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "true") {
+ // with AQE on, the WholeStageCodegen rule is applied when running
QueryStageExec.
+ val metrics = ArrayBuffer.empty[Long]
+ val listener = new QueryExecutionListener {
+ // Only test successful case here, so no need to implement `onFailure`
+ override def onFailure(funcName: String, qe: QueryExecution, error:
Throwable): Unit = {}
+
+ override def onSuccess(funcName: String, qe: QueryExecution, duration:
Long): Unit = {
+ val plan = qe.executedPlan match {
+ case a: AdaptiveSparkPlanExec => a.executedPlan
Review comment:
This appears many times, we can introduce a `stripAQEPlan` method in
`AdaptiveSparkPlanHelper` to do it.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]