Skip to content

[GLUTEN-13003][TEST] Replace constant-true testWithMinSparkVersion calls with test - #13004

Merged
jackylee-ch merged 4 commits into
apache:mainfrom
LuciferYang:spark33-residue-constant-guards
Sep 21, 2026
Merged

jackylee-ch merged 4 commits into
apache:mainfrom
LuciferYang:spark33-residue-constant-guards

Conversation

@LuciferYang

Copy link
Copy Markdown
Contributor

What changes are proposed in this pull request?

testWithMinSparkVersion(name, floor) registers a case only when the running Spark is at least floor (GlutenQueryTest.scala:132). Since #12902 the supported set is {3.4, 3.5, 4.0, 4.1}, so any floor of 3.4 or below is always satisfied and the call is a plain test(...) wearing a version check. This rewrites all 95 of them across 23 files: 84 with floor "3.4", 9 with "3.3", 2 with "3.2".

#12981 left the 3.4 group out of scope deliberately. The 3.3 and 3.2 groups are newer than that cleanup rather than older: #12454 branched before #12954 and merged between #12954 and #12981, so it brought the pattern back into backends-bolt after the first sweep and before the second one, which touched no bolt file.

The helper stays. Ten call sites still pass "3.5", and that floor does separate 3.4 from the rest.

Three things came off with the floors rather than being left dangling. BoltHashJoinSuite.scala had a "3.2" floor whose body still branched on startsWith("3.2.") in two places, so the floor and the assertions were one thing and removing only the floor would have been half a job; both 3.2. arms are gone and the surviving expectations are the ones the supported versions already take. Two comments existed only to justify a floor and now say something untrue or pointless: ScalarFunctionsValidateSuite.scala:655 claimed We currently test below functions with Spark v3.4 above a group that registers on all four, and DeltaSuite.scala:843 noted that TIMESTAMP_NTZ arrived in Spark 3.4, which constrains nothing once 3.4 is the minimum.

Otherwise no test body changed. The rewrite was done by script and then run through spotless:apply, so the remaining edits are the call itself and whatever reflowing scalafmt wanted afterwards; the collapsed multi-line calls are where the line counts move.

How was this patch tested?

clean test-compile on Spark 3.4, 3.5, 4.0 and 4.1 with -Pbackends-velox -Pspark-ut -Piceberg -Pdelta, Scala 2.13, which covers the velox, gluten-delta, gluten-iceberg and gluten-ut files. The 3.5 run adds -Pbackends-clickhouse for src-iceberg/test, that being the only profile clickhouse builds on.

The nine backends-bolt files needed a detour, since bolt does not compile on main at all right now. I stacked #12999 on top of this branch, ran test-compile -Pbackends-bolt -Pspark-ut on 3.4 and 3.5, then dropped it again, so what is pushed here is the rewrite alone.

No suite was run. For the 95 rewritten calls the change cannot alter what a case does, only whether it is registered, and every one of them was already registered on all four supported versions; a script checked that the set of case names each of the 23 files registers is identical before and after. The BoltHashJoinSuite assertion change is the one place that needed judgement rather than mechanics, and it cannot be run here: bolt's native library needs Linux plus GCC 10-12 or Clang 16 per docs/bolt-quick-start.md.

Was this patch authored or co-authored using generative AI tooling?

Generated-by: Claude claude-opus-5

Related issue: #13003

Copilot AI lite review requested due to automatic review settings September 12, 2026 06:02
@github-actions

Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

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.

🟢 Approval recommended

No unresolved blocking issues were identified in the reviewed changes.

Pull request overview

This PR removes redundant Spark-version guards from tests now that Spark 3.4 is the minimum supported version.

Changes:

  • Replaces 95 constant-true guards with test.
  • Removes obsolete Spark 3.2 hash-join assertions and outdated comments.
  • Preserves meaningful version-specific guards.
File summaries
File Description
gluten-ut/test/src/test/scala/org/apache/gluten/expressions/GlutenExpressionMappingSuite.scala Simplifies test registration.
gluten-iceberg/src/test/scala/org/apache/gluten/execution/IcebergSuite.scala Removes redundant version guards.
gluten-delta/src/test/scala/org/apache/gluten/execution/DeltaSuite.scala Removes redundant guards and an obsolete comment.
backends-velox/src/test/scala/org/apache/gluten/functions/ScalarFunctionsValidateSuite.scala Simplifies scalar-function tests.
backends-velox/src/test/scala/org/apache/gluten/functions/MathFunctionsValidateSuite.scala Simplifies math-function tests.
backends-velox/src/test/scala/org/apache/gluten/functions/JsonFunctionsValidateSuite.scala Simplifies JSON-function tests.
backends-velox/src/test/scala/org/apache/gluten/functions/DateFunctionsValidateSuite.scala Simplifies date-function tests.
backends-velox/src/test/scala/org/apache/gluten/expression/UDFPartialProjectSuite.scala Simplifies UDF tests.
backends-velox/src/test/scala/org/apache/gluten/execution/VeloxParquetDataTypeValidationSuite.scala Simplifies TimestampNTZ tests.
backends-velox/src/test/scala/org/apache/gluten/execution/VeloxAggregateFunctionsSuite.scala Simplifies aggregate-function tests.
backends-velox/src/test/scala/org/apache/gluten/execution/MiscOperatorSuite.scala Simplifies operator tests.
backends-velox/src/test/scala/org/apache/gluten/execution/FallbackSuite.scala Simplifies fallback tests.
backends-velox/src-iceberg/test/scala/org/apache/gluten/execution/VeloxIcebergSuite.scala Simplifies Iceberg tests.
backends-clickhouse/src-iceberg/test/scala/org/apache/gluten/execution/iceberg/ClickHouseIcebergSuite.scala Simplifies Iceberg tests.
backends-bolt/src/test/scala/org/apache/gluten/functions/ScalarFunctionsValidateSuite.scala Simplifies scalar-function tests.
backends-bolt/src/test/scala/org/apache/gluten/functions/MathFunctionsValidateSuite.scala Simplifies math-function tests.
backends-bolt/src/test/scala/org/apache/gluten/functions/JsonFunctionsValidateSuite.scala Simplifies JSON-function tests.
backends-bolt/src/test/scala/org/apache/gluten/functions/DateFunctionsValidateSuite.scala Simplifies date-function tests.
backends-bolt/src/test/scala/org/apache/gluten/execution/MiscOperatorSuite.scala Simplifies operator tests.
backends-bolt/src/test/scala/org/apache/gluten/execution/BoltStringFunctionsSuite.scala Simplifies string-function tests.
backends-bolt/src/test/scala/org/apache/gluten/execution/BoltHashJoinSuite.scala Removes obsolete Spark 3.2 assertions.
backends-bolt/src/test/scala/org/apache/gluten/execution/BoltColumnarCacheSuite.scala Simplifies cache tests.
backends-bolt/src/test/scala/org/apache/gluten/execution/BoltAggregateFunctionsSuite.scala Simplifies aggregate-function tests.
Review details
  • Files reviewed: 23/23 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI review requested due to automatic review settings September 14, 2026 02:46
@github-actions

Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

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.

🟢 Approval recommended

No unresolved blocking issues were identified.

Review details
  • Files reviewed: 23/23 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@LuciferYang

Copy link
Copy Markdown
Contributor Author

cc @jackylee-ch

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

👍

Copilot AI review requested due to automatic review settings September 17, 2026 05:39
@github-actions

Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

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.

🟢 Approval recommended

No unresolved review issues remain.

Review details
  • Files reviewed: 23/23 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@LuciferYang

Copy link
Copy Markdown
Contributor Author

@jackylee-ch can we merge this one?

@jackylee-ch
jackylee-ch merged commit 8409bda into apache:main Sep 21, 2026
69 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants