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

   Closes #238.
   
   Implements Spark-compatible `make_ym_interval([years[, months]])`, returning 
Arrow `Interval(YearMonth)` (a 32-bit month count). Years are multiplied by 12 
first (32-bit), then months are added, matching Spark's 
`IntervalUtils.makeYearMonthInterval` (`Math.multiplyExact` then 
`Math.addExact`); overflow raises an `INTERVAL_ARITHMETIC_OVERFLOW` error 
instead of returning NULL, which is the key difference from the sibling 
functions `make_interval` and `make_dt_interval` (those return NULL on 
overflow, tracked in #20). Both arguments are optional from the right and 
default to 0; NULL in, NULL out. Includes Rust unit tests and sqllogictest 
coverage (`datetime/make_ym_interval.slt`), and updates the function docs.
   
   Notes for reviewers:
   - The docs in `docs/functions/` were updated by hand following the docgen 
format; please let me know if `dev/update_function_docs.sh` produces anything 
different and I will align them.
   - Known limitations to confirm: the overflow error message uses Spark's 
`INTERVAL_ARITHMETIC_OVERFLOW` text; Spark 4.2 may attach extra query context — 
please say if a different format is wanted. Like the sibling functions, only 
integer types coerce to INT; DOUBLE/DECIMAL arguments fail coercion while Spark 
casts them (part of the broader cast gap in #88).


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