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_make_timestamp returns wrong values for invalid inputs instead of NULL #4554
When try_make_timestamp is called with column arguments containing invalid date/time components (e.g., month=13, day=32, hour=25), Comet runs the query natively (CometProject) but returns an incorrect timestamp value instead of NULL.
Spark's try_make_timestamp rewrites to MakeTimestamp(failOnError=false), which should return NULL instead of throwing an exception for invalid inputs.
Reproduction
CREATETABLEtest_try_make_ts(y int, mo int, d int, h int, mi int, s decimal(8,6)) USING parquet;
INSERT INTO test_try_make_ts VALUES (2024, 13, 1, 0, 0, 0.0), (2024, 6, 32, 0, 0, 0.0), (2024, 6, 15, 25, 0, 0.0);
SELECT try_make_timestamp(y, mo, d, h, mi, s) FROM test_try_make_ts;
Expected
All three rows should return NULL (invalid components).
Actual (Comet)
Returns garbage timestamp values (e.g., 1969-12-31 15:59:59.999999) for the invalid rows.
Notes
Literal invalid inputs (e.g., try_make_timestamp(2024, 13, 1, 0, 0, 0.0)) may also be affected.
Activity
docs: correct try_* datetime status from test findings (apache#4555, a…
fix: codegen dispatcher honors ev.isNull for nullable NullIntolerant …
fix: codegen dispatcher honors ev.isNull for nullable NullIntolerant …
fix: codegen dispatcher returns NULL for invalid try_make_timestamp i…
test: promote `try_to_date`/`try_to_timestamp` SQL tests to native co…
test: promote `try_to_date`/`try_to_timestamp` SQL tests to native co…
test: promote `try_to_date`/`try_to_timestamp` SQL tests to native co…