← Back to Pull requests

[AutoSparkUT] Migrate Spark 3.3 suites with test adaptations and exclusions [reduced-it] #16975

Closed
unknown closed this pull request without merging on Nov 23, 2026 10:52 UTC
View on GitHub
unknown unknown commented on Nov 17, 2026 06:47 UTC
Author

JaCoCo production line coverage: not fully measurable locally — local baseline is Scala 2.12/shim 350, incompatible with this Spark 3.3/shim 330 run; all applicable JVM modules remain unmeasured.

Contributes to #16848.

Fixes #17036.

Description

Enable ten Spark 3.3 suites with adaptations for RAPIDS. The tests cover literal and nondeterministic expressions, Hive hash aggregation, adaptive shuffle partition coalescing, exchange reuse, and interval distinct counts. These are test-only changes.

For adaptive shuffle, assert that seven inherited cases have no coalesced GPU shuffle readers and add six replacements that compare CPU and GPU rows, shuffle partition decisions, and exchange reuse. The aggregate-operator case remains tracked by #16970. The ANSI and TRY timezone replacements use Spark's SPARK-40851 timezone list and compare against Spark's expected values. The original timezone cases remain documented in #16971. Other remaining exclusions are tracked by #16856, #16857, and #16858.

Keep the two Hive hash aggregation suites in one shared test group. The fixture skips initialization when the slow Hive tag is excluded or include tags select neither child suite, cleans up leftover Spark contexts before starting, and puts Derby logs in the test temporary directory to avoid a source-tree license-check failure. Only Scala 2.12's Spark 3.3 release profile adds the Hive test JARs. Representative inherited count, UDAF and typed-aggregator cases check Spark's expected rows first on CPU and then with RAPIDS enabled, and assert GPU aggregation or the expected CPU fallback. The README documents whole-suite selection and the child test-name discovery limitation. The standalone Hive UDAF suite remains out of scope and its fallback case is tracked in #16859.

The interval test retains the zero-width bucket checks and adds populated buckets for both interval types. The JSON test verifies the typed CPU scan feeding a GPU projection and distinguishes LEGACY from CORRECTED handling. The Spark 3.3 Parquet V2 fallback test drains prior listener events and checks write callbacks, following SPARK-58030.

The initial local Spark 3.3.0 / Scala 2.12 serial run on an RTX 5880 Ada reported 268 passed, 0 failed, and 24 ignored across seven selected suite entry points before the AQE final-plan guard was added. A focused Spark 3.3.0 Maven run of the follow-up using Spark's plan output passed 13 AQE tests, with 0 failed and 7 ignored. The two Hive child suites passed 35 tests in a reused test worker JVM. Excluding the slow Hive tag left a preexisting SparkContext running and created no Derby log. An enabled run stopped a preexisting bare context and placed the Derby log under the test temporary directory. Maven Apache RAT approved all 516 files in the tests module.

The review follow-up passed 52 tests, 0 failed, and 7 existing ignored registrations across the Hive wrapper, adaptive shuffle and exchange/subquery reuse suites on Spark 3.3.0 / Scala 2.12 with an RTX 5880 Ada. The UNION replacement now requires an executed reused subquery. Separate probes confirmed that unmatched include tags and explicit Hive exclusions preserve an existing SparkContext without initializing Derby, and that the final adaptive-plan check succeeds with spark.sql.maxPlanStringLength=0.

Earlier Spark 3.3.0 GPU validation of RapidsApproxCountDistinctForIntervalsQuerySuite and RapidsJsonSuite reported 131 passed, 0 failed, and 1 ignored. The ignored interval case has a passing replacement.

AI assistance: The change and PR description were prepared with Codex assistance.

<details>
<summary>Adapted test provenance</summary>

| Original Spark test | Spark 3.3 source |
| --- | --- |
| default | LiteralExpressionSuite.scala:63-91 |
| SPARK-37967: Literal.create support ObjectType | LiteralExpressionSuite.scala:458-462 |
| MonotonicallyIncreasingID | NondeterministicSuite.scala:23-25 |
| SparkPartitionID | NondeterministicSuite.scala:27-29 |
| InputFileName | NondeterministicSuite.scala:31-33 |
| SPARK-32041: No reuse interference inside ReuseExchange | ReuseExchangeAndSubquerySuite.scala:29-68 |
| SPARK-32041: No reuse interference between ReuseExchange and ReuseSubquery | ReuseExchangeAndSubquerySuite.scala:70-114 |
| AQE partition coalescing and exchange reuse | CoalesceShufflePartitionsSuite.scala:96-442 |
| SPARK-35711 and SPARK-35719 | CastSuiteBase.scala:884-921 |
| SPARK-37138: Support Ansi Interval type in ApproxCountDistinctForIntervals | ApproxCountDistinctForIntervalsQuerySuite.scala:64-86 |

Current Spark reference sources: ApproxCountDistinctForIntervalsQuerySuite.scala, JsonSuite.scala, LiteralExpressionSuite.scala, NondeterministicSuite.scala, ReuseExchangeAndSubquerySuite.scala. The added SPARK-32041: executed GPU exchange reuse, union=false/true checks execute the first/second original query shapes.

</details>

Checklists

Documentation

  • Updated for new or modified user-facing features or behaviors

  • No user-facing change
  • Testing

  • Added or modified tests to cover new code paths

  • Covered by existing tests

  • (Please provide the names of the existing tests in the PR description.)
  • Not required
  • Performance

  • Tests ran and results are added in the PR description

  • Issue filed with a link in the PR description

  • Not required
  • Diff: 650 lines (+487 / -163) across 8 files Reviewer: wjxiz1992 Review duration: 8885m
    All Vouch review confidence checks passed
    Residual risk 0.30 = Change Risk (0.75) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.75 · 650 lines diff across 8 files
    0.75
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.075
    Real PR Conversation Timeline
    1 comments
    "Review active on #16975"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 75.2% (HIGH) · Higher = larger blast radius
    75.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 29.7% · Safe to merge
    29.7%