You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2026/10/08 10:09:00 UTC

[jira] [Updated] (SPARK-60073) try_make_timestamp throws ArithmeticException "long overflow" instead of returning NULL

     [ https://issues.apache.org/jira/browse/SPARK-60073?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

ASF GitHub Bot updated SPARK-60073:
-----------------------------------
    Labels: pull-request-available  (was: )

> try_make_timestamp throws ArithmeticException "long overflow" instead of returning NULL
> ---------------------------------------------------------------------------------------
>
>                 Key: SPARK-60073
>                 URL: https://issues.apache.org/jira/browse/SPARK-60073
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 3.5.8, 4.2.0, 4.1.1
>            Reporter: Yaoxuan Wu
>            Priority: Major
>              Labels: pull-request-available
>
> {{{}try_make_timestamp{}}}, {{try_make_timestamp_ntz}} and {{try_make_timestamp_ltz}} are documented to return NULL on invalid input. For a year outside the microsecond timestamp range (about |year| > 294247), they throw a raw {{java.lang.ArithmeticException}} instead. This happens with ANSI on and off, and both for constant-folded literals and for column input.
> {code:java}
> SELECT try_make_timestamp(999999, 1, 2, 3, 4, 5);
> -- expected: NULL
> -- actual:   java.lang.ArithmeticException: long overflow
> SELECT try_make_timestamp(y, 1, 2, 3, 4, 5) FROM VALUES (999999) t(y);   -- same {code}



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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org