Skip to content

[VL] Fix GlutenRemoveRedundantSortsSuite in Spark 4.x#12497

Merged
zml1206 merged 1 commit into
apache:mainfrom
zml1206:GlutenRemoveRedundantSortsSuite
Jul 14, 2026
Merged

[VL] Fix GlutenRemoveRedundantSortsSuite in Spark 4.x#12497
zml1206 merged 1 commit into
apache:mainfrom
zml1206:GlutenRemoveRedundantSortsSuite

Conversation

@zml1206

@zml1206 zml1206 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings July 10, 2026 09:38
@github-actions github-actions Bot added the CORE works for Gluten Core label Jul 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Spark 4.x (Spark 4.0 and 4.1) Gluten unit tests for redundant sort removal so they validate Gluten’s columnar sort operator (SortExecTransformer) and re-enables the suite in Velox backend test settings.

Changes:

  • Rewrote GlutenRemoveRedundantSortsSuite (Spark 4.0/4.1) to assert redundant-sort behavior by counting SortExecTransformer nodes.
  • Added SparkConf override to disable forced SHJ for the suite to stabilize join-related sort expectations.
  • Enabled GlutenRemoveRedundantSortsSuite in Spark 4.0/4.1 VeloxTestSettings, including all Gluten-prefixed tests.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
gluten-ut/spark41/src/test/scala/org/apache/spark/sql/execution/GlutenRemoveRedundantSortsSuite.scala Replaces Spark SortExec-based assumptions with SortExecTransformer-based assertions for Spark 4.1.
gluten-ut/spark41/src/test/scala/org/apache/gluten/utils/velox/VeloxTestSettings.scala Re-enables the redundant-sorts suite for Spark 4.1 Velox UTs and includes Gluten tests.
gluten-ut/spark40/src/test/scala/org/apache/spark/sql/execution/GlutenRemoveRedundantSortsSuite.scala Same test rewrite as Spark 4.1, adapted for Spark 4.0 module.
gluten-ut/spark40/src/test/scala/org/apache/gluten/utils/velox/VeloxTestSettings.scala Re-enables the redundant-sorts suite for Spark 4.0 Velox UTs and includes Gluten tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +718 to +720
enableSuite[GlutenRemoveRedundantSortsSuite]
// Rewrite as it check spark SortExec.
.includeAllGlutenTests()
Comment on lines +736 to +738
enableSuite[GlutenRemoveRedundantSortsSuite]
// Rewrite as it check spark SortExec.
.includeAllGlutenTests()
@zml1206 zml1206 requested review from philo-he and zhouyuan July 13, 2026 00:52
@zml1206

zml1206 commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

@zhouyuan @philo-he Should we disable tests that only verify optimization rules and are unrelated to Gluten? Examples include GlutenPlannerSuite, GlutenProjectedOrderingAndPartitioningSuite, GlutenRemoveRedundantProjectsSuite, GlutenRandomDataGeneratorSuite, GlutenSetCommandSuite, GlutenWholeStageCodegenSparkSubmitSuite, GlutenWholeStageCodegenSuite, GlutenExplainSuite, GlutenPythonDataSourceSuite, GlutenPythonUDFSuite, GlutenPythonUDTFSuite, and GlutenRowQueueSuite.

@zml1206 zml1206 marked this pull request as draft July 13, 2026 07:39
@zml1206

zml1206 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

@zhouyuan @philo-he Should we disable tests that only verify optimization rules and are unrelated to Gluten? Examples include GlutenPlannerSuite, GlutenProjectedOrderingAndPartitioningSuite, GlutenRemoveRedundantProjectsSuite, GlutenRandomDataGeneratorSuite, GlutenSetCommandSuite, GlutenWholeStageCodegenSparkSubmitSuite, GlutenWholeStageCodegenSuite, GlutenExplainSuite, GlutenPythonDataSourceSuite, GlutenPythonUDFSuite, GlutenPythonUDTFSuite, and GlutenRowQueueSuite.

One more thing: Spark 3.x does not enable these tests; I wonder if that is the reason.

@zml1206 zml1206 marked this pull request as ready for review July 14, 2026 04:00

@philo-he philo-he left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks for the continued efforts.

@philo-he

Copy link
Copy Markdown
Member

@zhouyuan @philo-he Should we disable tests that only verify optimization rules and are unrelated to Gluten? Examples include GlutenPlannerSuite, GlutenProjectedOrderingAndPartitioningSuite, GlutenRemoveRedundantProjectsSuite, GlutenRandomDataGeneratorSuite, GlutenSetCommandSuite, GlutenWholeStageCodegenSparkSubmitSuite, GlutenWholeStageCodegenSuite, GlutenExplainSuite, GlutenPythonDataSourceSuite, GlutenPythonUDFSuite, GlutenPythonUDTFSuite, and GlutenRowQueueSuite.

One more thing: Spark 3.x does not enable these tests; I wonder if that is the reason.

As discussed offline, if Gluten is still involved, we could try enabling the tests. By introducing and enabling them in Gluten, our goal is to check whether any issues arise when integrated with Gluten, which is slightly different from the original test purpose. Thank you!

@zml1206 zml1206 merged commit 061b799 into apache:main Jul 14, 2026
96 of 97 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CORE works for Gluten Core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants