Max Gekk created SPARK-57846:
--------------------------------

             Summary: Add the try_make_time function
                 Key: SPARK-57846
                 URL: https://issues.apache.org/jira/browse/SPARK-57846
             Project: Spark
          Issue Type: Sub-task
          Components: SQL
    Affects Versions: 4.3.0
            Reporter: Max Gekk


This sub-task is part of the umbrella SPARK-57550 (extend support for the TIME 
data type).

h2. Problem
{{make_time}} exists and throws on invalid input (timeExpressions.scala 
~L599-620; registered in FunctionRegistry.scala ~L748), but there is no 
{{try_make_time}}, unlike {{try_make_timestamp}} (FunctionRegistry.scala 
~L757). This is an error-handling parity gap.

h2. Goal
Add a {{try_make_time}} function that returns NULL instead of throwing when the 
hour/minute/second fields are out of range.

h2. Scope
Add a {{try_make_time}} expression builder (reusing {{MakeTime}} with TRY eval 
mode) and register it in {{FunctionRegistry}}.

h2. Acceptance criteria
* {{try_make_time(25, 0, 0)}} returns NULL; valid inputs match {{make_time}}.

h2. Testing
{{TimeExpressionsSuite}}; TIME golden files.

h2. Dependencies
None - independent.




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to