Copilot commented on code in PR #12766:
URL: https://github.com/apache/gluten/pull/12766#discussion_r3802986487
##########
gluten-ut/spark41/src/test/scala/org/apache/spark/sql/execution/adaptive/velox/VeloxAdaptiveQueryExecSuite.scala:
##########
@@ -1557,4 +1557,21 @@ class VeloxAdaptiveQueryExecSuite extends
AdaptiveQueryExecSuite with GlutenSQLT
}
}
}
+
+ // Gluten offloads EmptyRelationExec to EmptyRelationExecTransformer, so the
upstream
+ // `instanceof EmptyRelationExec` assertion no longer holds. Accept either
node.
+ testGluten("SPARK-35585: empty relation is correctly handled") {
+ withSQLConf(SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "true") {
+ val df = spark.sql("SELECT * FROM testData WHERE key < 0 INTERSECT
SELECT * FROM testData")
+ df.collect()
+ val plan = df.queryExecution.executedPlan
+ val emptyNodes = collectWithSubqueries(plan) {
+ case e: EmptyRelationExec => e
+ case e: EmptyRelationExecTransformer => e
+ }
+ assert(
+ emptyNodes.nonEmpty,
+ "Expected EmptyRelationExec or EmptyRelationExecTransformer in
plan:\n" + plan.treeString)
+ }
+ }
Review Comment:
This adds a SPARK-35585 test with the same name as the upstream Spark test,
while also removing SPARK-35585 from the excluded-tests list. If the upstream
`AdaptiveQueryExecSuite` still defines `SPARK-35585: empty relation is
correctly handled`, the suite may either (a) register duplicate test names
(ScalaTest can throw `DuplicateTestNameException`) or (b) run both tests,
leaving the upstream one failing due to the changed plan node. To make this
robust, either explicitly ignore/disable the inherited upstream test in this
suite and keep this as the replacement, or rename this test so both can coexist
without collisions (and keep the upstream one excluded if it’s expected to fail
under Gluten).
--
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]