Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[VL] Flaky Spark 4.2 UT: GlutenTransformWithStateUnsafeRowSuite "test that introducing TTL after restart fails query"

Open Beginner friendly
#13,463 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
github-actions, scala, spark
Domain
ci-cd, testing

Research direction

Start in gluten-ut/spark42/.../VeloxTestSettings.scala and inspect the GlutenTransformWithStateUnsafeRowSuite settings. Exclude tests with the prefix test that introducing TTL after restart fails query to stop the flaky cases from blocking CI. Run the Spark 4.2 test job and confirm both variants are excluded; the Spark failure investigation and re-enabling the tests are follow-up work.

Written by the indexing model from the issue text.

Description

bug unit testing velox backend
Backend

VL (Velox)

Bug description

GlutenTransformWithStateUnsafeRowSuite (Spark 4.2) is flaky in the spark-test-spark42 (1) CI job. The failing test is:

  • test that introducing TTL after restart fails query (encoding = UnsafeRow) (with changelog checkpointing)
  • test that introducing TTL after restart fails query (encoding = UnsafeRow) (without changelog checkpointing)

The two variants fail intermittently; which one fails changes from run to run. The test reports a failure with the exception it expects:

org.apache.spark.sql.execution.streaming.state.StateStoreValueSchemaNotCompatible: [STATE_STORE_VALUE_SCHEMA_NOT_COMPATIBLE] Provided value schema does not match existing state value schema.
Please check number and type of fields.
Existing value_schema=StructType(StructField(value,LongType,false)) and new value_schema=StructType(StructField(value,StructType(StructField(value,LongType,false)),true),StructField(ttlExpirationMs,LongType,true)).
  at org.apache.spark.sql.execution.streaming.state.StateStoreErrors$.stateStoreValueSchemaNotCompatible(StateStoreErrors.scala:170)
  at org.apache.spark.sql.execution.streaming.state.StateSchemaCompatibilityChecker.check(StateSchemaCompatibilityChecker.scala:247)
  ...

Gluten doesn't execute any part of this query: every operator (MicroBatchScan, TransformWithState, Exchange, Sort, WriteToDataSourceV2, ...) falls back to vanilla Spark. The test expects this exception inside ExpectFailure[StateStoreValueSchemaNotCompatible], but sometimes the error appears to escape before ExpectFailure can catch it. This looks like a timing race in the Spark test itself, not a Gluten correctness problem.

Recent failures in unrelated PRs and in the scheduled main run:

Proposed action

Short term: exclude the test in gluten-ut/spark42/.../VeloxTestSettings.scala so it stops blocking CI:

  enableSuite[GlutenTransformWithStateUnsafeRowSuite]
    .excludeByPrefix("test that introducing TTL after restart fails query")

Follow-up: find out why the error escapes ExpectFailure (possibly made more likely by running suites in parallel JVMs), then either fix it or report it upstream to Spark, and re-enable the test.

Spark version

Spark 4.2.0

Dominant language
Scala
Stars
1.6k
Forks
665
Avg merge
4d 45m
Merged PRs (30d)
111

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/gluten

All issues in apache/gluten

Similar issues

More Scala issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.