Skip to content

Native make_date rejects Spark-valid years outside chrono range #5208

Description

@peterxcli

Describe the bug

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.

Steps to reproduce

Run:

SELECT make_date(300000, 6, 15);

Spark returns +300000-06-15. Native Comet returns NULL in non-ANSI mode and throws in ANSI mode.

Expected behavior

Native Comet should match Spark for dates representable by Spark DateType.

Additional context

Found while reviewing #5167. The chrono range limitation predates that pull request; #5167 only fixes ANSI exception fidelity.

Metadata

Metadata

Assignees

Labels

area:expressionsExpression evaluationbugSomething isn't workingcorrectnesspriority:mediumFunctional bugs, performance regressions, broken features

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions