[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
Open
[SPARK-57560][SQL][TESTS][FOLLOWUP] Update the Java 21 golden file for TIME try arithmetic tests#56894MaxGekk wants to merge 1 commit into
MaxGekk wants to merge 1 commit into
Conversation
…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
pan3793
approved these changes
Jun 30, 2026
zhengruifeng
approved these changes
Jun 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.sqland regenerated the base golden files. However,nonansi/try_arithmetic.sql.outhas a Java-21-specific variantnonansi/try_arithmetic.sql.out.java21(the suite reads it whenUtils.isJavaVersionAtLeast21, because JDK-4511638 changes thetoStringofFloat/Double). That.java21variant 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 thetry_divide(1, (2147483647 + 1))double output:-4.6566128730773926E-10-4.656612873077393E-10The new TIME outputs (time values, NULLs, and day-time intervals) are Java-version stable, so they are identical in the base and
.java21files. The ANSItry_arithmetic.sql.outneeds no.java21variant because thattry_dividedouble query only appears in non-ANSI mode (in ANSI mode the inner2147483647 + 1overflows).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?
nonansi/try_arithmetic.sql.out.java21differs from the basenonansi/try_arithmetic.sql.outby exactly the onetry_dividedouble 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