pedrumj2 opened a new pull request, #60710: URL: https://github.com/apache/spark/pull/60710
### What changes were proposed in this pull request? Every NOT NULL check now passes its write to one protected helper, which runs the write and intercepts the exception it throws. A subclass can override that helper to expect a different exception. The tests assert the same things as before. ### Why are the changes needed? [apache/gluten#12976](https://github.com/apache/gluten/pull/12976) enabled [`map_from_arrays`](https://spark.apache.org/docs/latest/api/sql/map-functions/#map_from_arrays) in Gluten's Velox backend. Gluten runs Spark's test suites against that backend. With that change, Gluten raises a different exception than three tests of [`RuntimeNullChecksV2Writes`](https://github.com/apache/spark/blob/642e11ce14be2e1423799cb0581ce6a26a068a86/sql/core/src/test/scala/org/apache/spark/sql/RuntimeNullChecksV2Writes.scala) check for. For Spark 3.5, 4.0 and 4.1, that pull request skipped the three tests and added copies of them whose only change is the exception check. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? ``` $ build/sbt 'sql/testOnly org.apache.spark.sql.RuntimeNullChecksV2Writes' ... [info] RuntimeNullChecksV2Writes: [info] - NOT NULL checks for atomic top-level fields (byName) (2 seconds, 354 milliseconds) [info] - NOT NULL checks for atomic top-level fields (byPosition) (139 milliseconds) [info] - NOT NULL checks for nested structs, arrays, maps (byName) (498 milliseconds) [info] - NOT NULL checks for nested structs, arrays, maps (byPosition) (261 milliseconds) [info] - NOT NULL checks for nested struct fields (byName) (485 milliseconds) [info] - NOT NULL checks for nested struct fields (byPosition) (218 milliseconds) [info] - NOT NULL checks for nullable array with required element (byName) (259 milliseconds) [info] - NOT NULL checks for nullable array with required element (byPosition) (172 milliseconds) [info] - NOT NULL checks for fields inside nullable array (byName) (211 milliseconds) [info] - not null checks for fields inside nullable array (byPosition) (169 milliseconds) [info] - NOT NULL checks for nullable map with required values (byName) (190 milliseconds) [info] - NOT NULL checks for nullable map with required values (byPosition) (150 milliseconds) [info] - NOT NULL checks for fields inside nullable maps (byName) (281 milliseconds) [info] - NOT NULL checks for fields inside nullable maps (byPosition) (220 milliseconds) [info] Run completed in 8 seconds, 37 milliseconds. [info] Total number of tests run: 14 [info] Suites: completed 1, aborted 0 [info] Tests: succeeded 14, failed 0, canceled 0, ignored 0, pending 0 [info] All tests passed. ``` ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Co-authored with Claude Code 2.1.328 (claude-opus-5-5) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
