Skip to content

Implement Spark-compatible CAST from String to Date #327

@andygrove

Description

@andygrove

What is the problem the feature request solves?

What is the problem the feature request solves?

We currently delegate to DataFusion when casting from string to date and there are some differences in behavior compared to Spark.

  • Spark supports dates in the format YYYY and YYYY-MM and DataFusion does not
  • Spark supports a trailing T as in 2024-01-01T and DataFusion does not
  • DataFusion doesn't throw an exception for invalid inputs in ANSI mode

Edge cases from fuzz testing:

Input Spark DataFusion
"-0973250" 3251-01-01 null
"-3638-5" 3639-05-01 null

Describe the potential solution

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions