yadavay-amzn opened a new pull request, #56932:
URL: https://github.com/apache/spark/pull/56932

   ### What changes were proposed in this pull request?
   
   Adds the `try_make_time(hour, minute, second)` function, the error-safe 
counterpart to `make_time`: it returns the same result on valid input and 
`NULL` (instead of throwing) on invalid input. It is implemented as 
`TryEval(MakeTime(...))`, mirroring `try_make_timestamp`. Registered in the 
function registry, exposed via `functions.scala`, and documented 
(ANSI-compliance try-functions list + `sql-expression-schema`).
   
   ### Why are the changes needed?
   
   `make_time` throws on invalid components (e.g. `hour = 25`). Users want a 
null-returning variant consistent with the other `try_*` datetime constructors 
(`try_make_timestamp`, etc.).
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes - a new function `try_make_time`.
   
   ### How was this patch tested?
   
   Unit tests (`TimeExpressionsSuite`), integration (`TimeFunctionsSuiteBase`), 
SQL-level (`time.sql`), and Connect plan-generation goldens: valid input equals 
`make_time`, invalid input returns `NULL`.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Authored with assistance by Claude Opus 4.8.
   


-- 
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]

Reply via email to