andygrove opened a new issue, #4554:
URL: https://github.com/apache/datafusion-comet/issues/4554

   ## 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
   
   ```sql
   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
   
   - Literal invalid inputs (e.g., `try_make_timestamp(2024, 13, 1, 0, 0, 
0.0)`) may also be affected.
   - The related feature request is #3117.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to