Skip to content

Implement Spark-compatible CAST from String to Timestamp #328

Closed

Description

@andygrove

What is the problem the feature request solves?

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

  • Spark treats many parts of the timestamp as optional
  • There are timezone-related differences
  • DataFusion does not throw exceptions on invalid inputs in ANSI mode

Examples of differences:

Input Spark Comet
2020 2020-01-01 00:00:00.0 null
2020-01 2020-01-01 00:00:00.0 null
2020-01-01 2020-01-01 00:00:00.0 2019-12-31 16:00:00.0
2020-01-01T12 2020-01-01 12:00:00.0 null
2020-01-01T12:34 2020-01-01 12:34:00.0 null
2020-01-01T12:34:56 2020-01-01 12:34:56.0 2020-01-01 04:34:56.0
2020-01-01T12:34:56.123456 2020-01-01 12:34:56.123456 2020-01-01 04:34:56.123456
T2 2024-04-25 02:00:00.0 null

Describe the potential solution

No response

Additional context

No response

Activity

  1. added
    enhancement
    good first issue
    help wanted
    on Apr 25, 2024
  2. vaibhawvipul commented on Apr 26, 2024

    @vaibhawvipul
    Contributor

    I would love to work on this. If no one else is working on it.

  3. andygrove commented on May 24, 2024

    @andygrove
    MemberAuthor

    There is a follow on issue to complete this work: #376

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgood first issuehelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions