Skip to content

[SPARK-57560][SQL][TESTS][FOLLOWUP] Update the Java 21 golden file for TIME try arithmetic tests#56894

Open
MaxGekk wants to merge 1 commit into
apache:masterfrom
MaxGekk:time-try-eval-java21
Open

[SPARK-57560][SQL][TESTS][FOLLOWUP] Update the Java 21 golden file for TIME try arithmetic tests#56894
MaxGekk wants to merge 1 commit into
apache:masterfrom
MaxGekk:time-try-eval-java21

Conversation

@MaxGekk

@MaxGekk MaxGekk commented Jun 30, 2026

Copy link
Copy Markdown
Member

What changes were proposed in this pull request?

This is a follow-up of #56819, addressing the Java 21/25 build failures reported there.

#56819 added TIME cases to try_arithmetic.sql and regenerated the base golden files. However, nonansi/try_arithmetic.sql.out has a Java-21-specific variant nonansi/try_arithmetic.sql.out.java21 (the suite reads it when Utils.isJavaVersionAtLeast21, because JDK-4511638 changes the toString of Float/Double). That .java21 variant was left stale -- it was missing the new TIME rows -- so on Java 21+ the test compared actual output (with TIME rows) against the stale golden file and failed.

This PR adds the new TIME rows to nonansi/try_arithmetic.sql.out.java21. The only genuine Java 21 difference in this file remains the try_divide(1, (2147483647 + 1)) double output:

  • Java 8/11/17: -4.6566128730773926E-10
  • Java 21+: -4.656612873077393E-10

The new TIME outputs (time values, NULLs, and day-time intervals) are Java-version stable, so they are identical in the base and .java21 files. The ANSI try_arithmetic.sql.out needs no .java21 variant because that try_divide double query only appears in non-ANSI mode (in ANSI mode the inner 2147483647 + 1 overflows).

Why are the changes needed?

To fix the Java 21/25 build failures observed after #56819 was merged, e.g.:

Does this PR introduce any user-facing change?

No. Test-only.

How was this patch tested?

  • Verified nonansi/try_arithmetic.sql.out.java21 differs from the base nonansi/try_arithmetic.sql.out by exactly the one try_divide double line, consistent with the existing Java 21 golden file convention.
  • build/sbt 'sql/testOnly org.apache.spark.sql.SQLQueryTestSuite -- -z try_arithmetic'

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

Generated-by: Cursor

…r TIME try arithmetic tests

### What changes were proposed in this pull request?
This is a follow-up of apache#56819. That PR added TIME cases to `try_arithmetic.sql` and
regenerated the base golden files, but `nonansi/try_arithmetic.sql.out` has a
Java-21-specific variant (`nonansi/try_arithmetic.sql.out.java21`, needed because
JDK-4511638 changes the `toString` of `Float`/`Double`) that was left stale, missing
the new TIME rows. On Java 21+ the suite reads the `.java21` variant, so the build
failed.

This PR adds the new TIME rows to `nonansi/try_arithmetic.sql.out.java21`. The only
genuine Java 21 difference remains the `try_divide(1, (2147483647 + 1))` double output
(`-4.656612873077393E-10` on Java 21 vs `-4.6566128730773926E-10` on Java 8/11/17);
the new TIME outputs are Java-version stable. The ANSI `try_arithmetic.sql.out` has no
`.java21` variant because that double query only appears in non-ANSI mode.

### Why are the changes needed?
To fix the Java 21/25 build failures reported on apache#56819.

### Does this PR introduce _any_ user-facing change?
No. Test-only.

### How was this patch tested?
- `nonansi/try_arithmetic.sql.out.java21` now differs from the base file by exactly the
  one `try_divide` double line, matching the prior Java 21 variant convention.
- `build/sbt 'sql/testOnly org.apache.spark.sql.SQLQueryTestSuite -- -z try_arithmetic'`
  on Java 21.

### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Cursor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants