Describe the bug
make_date(year, month, day) in Comet accepts year = 0 and negative years, returning a valid date built via chrono's proleptic Gregorian calendar. Spark rejects these (returns NULL in non-ANSI mode, throws under ANSI). The Rust test test_make_date_extreme_years in native/spark-expr/src/datetime_funcs/make_date.rs acknowledges this acceptance.
Steps to reproduce
SELECT make_date(0, 1, 1);
-- Spark: NULL (or throws under ANSI)
-- Comet: 0000-01-01
SELECT make_date(-1, 1, 1);
-- Spark: NULL (or throws under ANSI)
-- Comet: -0001-01-01
Expected behavior
Match Spark: reject years outside [1, 9999].
Additional context
Surfaced by the date/time audit (#4448). Reproducer captured as an ignored test in spark/src/test/resources/sql-tests/expressions/datetime/make_date.sql; remove the ignore(...) when this is fixed.
Describe the bug
make_date(year, month, day)in Comet acceptsyear = 0and negative years, returning a valid date built via chrono's proleptic Gregorian calendar. Spark rejects these (returns NULL in non-ANSI mode, throws under ANSI). The Rust testtest_make_date_extreme_yearsinnative/spark-expr/src/datetime_funcs/make_date.rsacknowledges this acceptance.Steps to reproduce
Expected behavior
Match Spark: reject years outside
[1, 9999].Additional context
Surfaced by the date/time audit (#4448). Reproducer captured as an ignored test in
spark/src/test/resources/sql-tests/expressions/datetime/make_date.sql; remove theignore(...)when this is fixed.