andygrove opened a new pull request, #72:
URL: https://github.com/apache/datafusion-spark/pull/72

   ## Summary
   - Adds Spark 4.1+'s `make_time(hour, minute, second)`, ported from 
DataFusion Comet's `datetime_funcs/make_time.rs`.
   - Returns `Time64(Nanosecond)` (Spark's `TIME(6)`). NULL if any argument is 
NULL.
   - Out-of-range fields raise 
`DATETIME_FIELD_OUT_OF_BOUNDS.WITHOUT_SUGGESTION` with Spark's message 
(`Invalid value for HourOfDay (valid values 0 - 23): -1`), whatever the ANSI 
setting. Seconds are checked first and reported truncated toward zero, like 
Spark.
   - Arguments are coerced like Spark's `ImplicitCastInputTypes`: any integer 
to INT for hour and minute, any numeric to `DECIMAL(16, 6)` for seconds. 
DataFusion types bare integer literals as BIGINT, so a strict INT signature 
would reject `make_time(1, 18, 19.87)`.
   
   ## Testing
   - Unit tests and `datetime/make_time.slt`. Expected values and error 
messages come from Spark's `time.sql.out` golden file.
   - `cargo clippy --all-targets --all-features -- -D warnings`, `cargo test -p 
datafusion-spark` and `cargo test -p datafusion-spark-sqllogictest` pass.


-- 
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