You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Native make_date rejects Spark-valid years outside chrono range #5208
Native make_date uses chrono NaiveDate, which supports years from -262143 through 262142. Spark accepts wider years when their epoch-day value fits DateType, so Comet returns NULL with ANSI mode disabled or throws with ANSI mode enabled for dates Spark accepts.
For invalid dates outside chrono's range, Comet can also produce a factually incorrect error message. For example, it reports that year 300000 is not a leap year even though it is divisible by 400.
Steps to reproduce
Run:
SELECT make_date(300000, 6, 15); -- Comet rejects this Spark-valid date outside the chrono year rangeSELECT make_date(300000, 2, 29); -- Comet also incorrectly reports that 300000 is not a leap year
Spark returns +300000-06-15 and +300000-02-29. Native Comet returns NULL in non-ANSI mode and throws in ANSI mode. The ANSI error for the second query incorrectly says that 300000 is not a leap year.
Expected behavior
Native Comet should match Spark for dates representable by Spark DateType and should not produce factually incorrect error messages.
Additional context
Found while reviewing #5167. The chrono range limitation predates that pull request; #5167 only fixes ANSI exception fidelity.
Activity
comphead commentedon Aug 2, 2026
Thanks @peterxcli for reporting this