Bug Report
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
CREATE TABLE test_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
Bug Report
When
try_make_timestampis 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_timestamprewrites toMakeTimestamp(failOnError=false), which should return NULL instead of throwing an exception for invalid inputs.Reproduction
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
try_make_timestamp(2024, 13, 1, 0, 0, 0.0)) may also be affected.