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

   ## Summary
   - Adds Spark's `date_from_unix_date(days)`, ported from DataFusion Comet's 
`datetime_funcs/date_from_unix_date.rs`. It is the inverse of `unix_date`.
   - The argument is an INT. Other integer types are cast to INT, using the 
same `Coercion` as `make_dt_interval`, since DataFusion types bare integer 
literals as BIGINT. NULL gives NULL.
   - Returns `Date32`. Every INT is a valid date, so there is no error case. 
The array path is an `Int32` to `Date32` cast that reuses the buffer.
   
   ## Testing
   - Unit test and `datetime/date_from_unix_date.slt`. Expected values come 
from Spark's `date.sql.out` golden file.
   - Very large day counts such as `2147483647` are valid but cannot be printed 
by Arrow's date formatter, so the slt checks them through a `unix_date` round 
trip.
   - `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