You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TRY_CAST returns an error instead of NULL for timestamp/date overflow #22896
SELECT TRY_CAST(
arrow_cast(9223372037, 'Timestamp(s)')
ASTIMESTAMP(9)
) AS ts;
actual output:
Optimizer rule 'simplify_expressions' failed
Execution("Cannot cast Timestamp(s) value 9223372037 to Timestamp(ns): converted value exceeds the representable i64 range")
Date -> Timestamp(Nanosecond) overflow:
SELECT CAST(DATE'3000-01-01'ASTIMESTAMP(9)
actual output:
Optimizer rule 'simplify_expressions' failed
Execution("Cannot cast Date32 value 376200 to Timestamp(ns): converted value exceeds the representable i64 range")
Expected behavior
Both TRY_CAST queries should return NULL, while the equivalent CAST queries should continue to return errors.
Activity
fengys1996 commentedon Jun 11, 2026
take
fix: TRY_CAST returns NULL for timestamp/date overflow (apache#22897)