michaelmitchell-bit opened a new pull request, #56999: URL: https://github.com/apache/spark/pull/56999
### What changes were proposed in this pull request? This PR makes unsupported datetime functions reject `TIME` inputs consistently instead of accepting them through implicit date/timestamp/string coercion paths. The change blocks implicit `TIME` <-> non-`TIME` datetime coercion in the SQL type coercion rules, adds a local guard for `to_date`/`try_to_date`, and returns a named type-mismatch error for `window_time` structs containing `TIME` fields. It also adds negative coverage for the date, calendar, epoch, time-zone, and event-time windowing functions listed in SPARK-57561. ### Why are the changes needed? SPARK-57561 tracks that date/zone/epoch-bound datetime functions should stay unsupported for `TIME`. Without explicit checks, some functions can silently accept `TIME` after related `TIME` <-> `TIMESTAMP` work, which makes unsupported behavior harder to detect and produces inconsistent errors. ### Does this PR introduce _any_ user-facing change? Yes. On unreleased `master`, unsupported datetime functions now reject `TIME` inputs consistently during analysis instead of silently accepting them through implicit coercion in some paths. ### How was this patch tested? Added tests. ``` ./build/sbt "sql/testOnly org.apache.spark.sql.TimeFunctionsAnsiOnSuite -- -z SPARK-57561" ./build/sbt "sql/testOnly org.apache.spark.sql.TimeFunctionsAnsiOffSuite -- -z SPARK-57561" ./build/sbt "sql/testOnly org.apache.spark.sql.TimeFunctionsAnsiOnSuite org.apache.spark.sql.TimeFunctionsAnsiOffSuite" ./build/sbt "catalyst/testOnly org.apache.spark.sql.catalyst.analysis.TypeCoercionSuite org.apache.spark.sql.catalyst.analysis.AnsiTypeCoercionSuite" ./dev/scalastyle ``` ### Was this patch authored or co-authored using generative AI tooling? Generated-by: OpenAI Codex (GPT-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]
