Skip to content

[CORE] Limit SparkSessionExtension suite to Gluten test - #12475

Merged
zml1206 merged 2 commits into
apache:mainfrom
zml1206:GlutenSparkSessionExtensionSuite
Jul 9, 2026
Merged

zml1206 merged 2 commits into
apache:mainfrom
zml1206:GlutenSparkSessionExtensionSuite

Conversation

@zml1206

@zml1206 zml1206 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Enable GlutenSparkSessionExtensionSuite for Spark 4.0/4.1 Velox UTs.
The suite should not mix in GlutenTestsTrait, because that trait initializes a shared Gluten Spark session in beforeAll. Spark’s upstream SparkSessionExtensionSuite creates sessions with custom extensions per test, and reusing an existing session may cause injected extensions such as analyzer rules to be ignored.
This patch changes Spark 4.0/4.1 GlutenSparkSessionExtensionSuite to use GlutenTestsCommonTrait, matching the suite’s need for Gluten test filtering without creating a shared session, then enables the suite in Velox test settings.

Copilot AI review requested due to automatic review settings July 8, 2026 06:26
@github-actions github-actions Bot added the CORE works for Gluten Core label Jul 8, 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 re-enables GlutenSparkSessionExtensionSuite for Spark 4.0/4.1 Velox unit tests by removing reliance on GlutenTestsTrait (which initializes a shared SparkSession in beforeAll) and switching to GlutenTestsCommonTrait to preserve Gluten test filtering while allowing Spark’s upstream SparkSessionExtensionSuite to create per-test sessions with custom extensions.

Changes:

  • Update Spark 4.0 and 4.1 GlutenSparkSessionExtensionSuite to mix in GlutenTestsCommonTrait instead of GlutenTestsTrait, avoiding shared-session side effects.
  • Enable GlutenSparkSessionExtensionSuite in Spark 4.0 and 4.1 Velox test settings.

Reviewed changes

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

File Description
gluten-ut/spark41/src/test/scala/org/apache/spark/sql/GlutenSparkSessionExtensionSuite.scala Switches from GlutenTestsTrait to GlutenTestsCommonTrait to prevent shared-session initialization from interfering with per-test extensions.
gluten-ut/spark41/src/test/scala/org/apache/gluten/utils/velox/VeloxTestSettings.scala Enables GlutenSparkSessionExtensionSuite in Spark 4.1 Velox test matrix.
gluten-ut/spark40/src/test/scala/org/apache/spark/sql/GlutenSparkSessionExtensionSuite.scala Same trait switch for Spark 4.0 to avoid shared-session behavior.
gluten-ut/spark40/src/test/scala/org/apache/gluten/utils/velox/VeloxTestSettings.scala Enables GlutenSparkSessionExtensionSuite in Spark 4.0 Velox test matrix.

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

@zml1206
zml1206 requested review from philo-he and zhouyuan July 8, 2026 09:25
@philo-he

philo-he commented Jul 9, 2026

Copy link
Copy Markdown
Member

@zml1206, thanks for the fix. One comment, which might be slightly beyond the scope of this PR. Please check if it makes sense.

I noticed this suite runs all the parent SparkSessionExtensionSuite tests without the Gluten plugin or any Gluten-specific configuration. Those are Spark's own tests and can be covered on the Spark side, so there's no need to run them on Gluten.

Could we use includeGlutenTest("customColumnarOp") to enable only this Gluten test, where the Gluten plugin and related config are actually applied to the Spark session? This test was introduced by #4165 and isn't intended to cover Spark's own tests the way other suites do.

Alternatively, if the test doesn't really depend on SparkSessionExtensionSuite, could we move it to a new suite under gluten-ut/test?

Copilot AI review requested due to automatic review settings July 9, 2026 02:19
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

@zml1206

zml1206 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

@zml1206, thanks for the fix. One comment, which might be slightly beyond the scope of this PR. Please check if it makes sense.

I noticed this suite runs all the parent SparkSessionExtensionSuite tests without the Gluten plugin or any Gluten-specific configuration. Those are Spark's own tests and can be covered on the Spark side, so there's no need to run them on Gluten.

Could we use includeGlutenTest("customColumnarOp") to enable only this Gluten test, where the Gluten plugin and related config are actually applied to the Spark session? This test was introduced by #4165 and isn't intended to cover Spark's own tests the way other suites do.

Alternatively, if the test doesn't really depend on SparkSessionExtensionSuite, could we move it to a new suite under gluten-ut/test?

Thanks for the suggestion. It makes sense to avoid running the parent SparkSessionExtensionSuite tests here since they are Spark-side coverage and do not require Gluten-specific configuration.

I'll update the suite settings to enable only the Gluten-specific test with includeGlutenTest("customColumnarOp"). I prefer this over moving the test for now because the test still reuses SparkSessionExtensionSuite helpers, and the scoped include keeps the PR minimal.

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

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Comment on lines 2076 to +2077
enableSuite[GlutenSparkSessionExtensionSuite]
.includeGlutenTest("customColumnarOp")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated

@zml1206 zml1206 changed the title [VL] Fix GlutenSparkSessionExtensionSuite in Spark 4.x [CORE] Limit SparkSessionExtension suite to Gluten test Jul 9, 2026

@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.

Thanks!

@zml1206
zml1206 merged commit ef647ca into apache:main Jul 9, 2026
58 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