[GLUTEN-11550][VL] Fix GlutenWholeStageCodegenSuite in Spark 4.x#12507
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.
This PR aims to make GlutenWholeStageCodegenSuite work on Spark 4.x by replacing Spark’s row-based WholeStageCodegen plan assertions with Gluten-aware WholeStageTransformer/native transformer assertions, and then enabling the suite in Velox backend settings.
Changes:
- Expanded
GlutenWholeStageCodegenSuite(Spark 4.0 / 4.1) from an empty subclass into a full set of Gluten-aware test cases + helper assertions. - Enabled
GlutenWholeStageCodegenSuitein Velox test settings (Spark 4.0 / 4.1) with targeted excludes.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| gluten-ut/spark41/src/test/scala/org/apache/spark/sql/execution/GlutenWholeStageCodegenSuite.scala | Replaces empty suite with Gluten-aware WholeStage/native operator assertions and reintroduced test cases. |
| gluten-ut/spark41/src/test/scala/org/apache/gluten/utils/velox/VeloxTestSettings.scala | Enables the suite for Velox backend and configures exclusions. |
| gluten-ut/spark40/src/test/scala/org/apache/spark/sql/execution/GlutenWholeStageCodegenSuite.scala | Same as Spark 4.1 version: adds Gluten-aware test implementations and helpers. |
| gluten-ut/spark40/src/test/scala/org/apache/gluten/utils/velox/VeloxTestSettings.scala | Same as Spark 4.1 version: enables suite and configures exclusions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| import scala.reflect.ClassTag | ||
|
|
||
| class GlutenWholeStageCodegenSuite extends WholeStageCodegenSuite with GlutenSQLTestsTrait { |
| } | ||
| } | ||
|
|
||
| testGluten("range/filter should be combined") { |
| checkAnswer(df, Row(2)) | ||
| } | ||
|
|
||
| testGluten("HashAggregate should be included in WholeStageCodegen") { |
|
|
||
| import scala.reflect.ClassTag | ||
|
|
||
| class GlutenWholeStageCodegenSuite extends WholeStageCodegenSuite with GlutenSQLTestsTrait { |
| } | ||
| } | ||
|
|
||
| testGluten("range/filter should be combined") { |
| checkAnswer(df, Row(2)) | ||
| } | ||
|
|
||
| testGluten("HashAggregate should be included in WholeStageCodegen") { |
| enableSuite[GlutenWholeStageCodegenSuite] | ||
| // Rewrite with Gluten-aware native whole-stage plan assertions. | ||
| .exclude("range/filter should be combined") | ||
| .exclude("HashAggregate should be included in WholeStageCodegen") | ||
| .exclude("SortAggregate should be included in WholeStageCodegen") |
| enableSuite[GlutenWholeStageCodegenSuite] | ||
| // Rewrite with Gluten-aware native whole-stage plan assertions. | ||
| .exclude("range/filter should be combined") | ||
| .exclude("HashAggregate should be included in WholeStageCodegen") | ||
| .exclude("SortAggregate should be included in WholeStageCodegen") |
Related issue: #11550