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

   ## Which issue does this PR close?
   
   Part of the datafusion-spark epic: 
https://github.com/apache/datafusion/issues/15914
   
   ## Rationale for this change
   
   `date_from_unix_date` is a Spark built-in that creates a date from the 
number of days since the Unix epoch (1970-01-01). It is the inverse of the 
existing `unix_date` function and is not yet available in the 
`datafusion-spark` crate.
   
   ## What changes are included in this PR?
   
   - Adds `SparkDateFromUnixDate` under 
`datafusion/spark/src/function/datetime/`, registered in the datetime module. 
The implementation lowers to a single `Int32 -> Date32` cast in `simplify()`, 
mirroring the existing `unix_date` idiom, since both types represent days since 
epoch.
   - Adds sqllogictest coverage under 
`test_files/spark/datetime/date_from_unix_date.slt` for scalar, array, 
negative, and NULL inputs.
   
   ## Are these changes tested?
   
   Yes, via sqllogictest with scalar and array inputs (including negative and 
NULL cases).


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