Skip to content

[EPIC] [DISCUSS] Comet timezone handling #2733

Closed

Description

@andygrove

What is the problem the feature request solves?

Comet currently assumes that all native processing uses the UTC timezone. When reading from Parquet sources, Comet converts timestamps to UTC.

      String timeZoneId = conf.get("spark.sql.session.timeZone");
      // Native code uses "UTC" always as the timeZoneId when converting from spark to arrow schema.
      Schema arrowSchema = Utils$.MODULE$.toArrowSchema(sparkSchema, "UTC");
      byte[] serializedRequestedArrowSchema = serializeArrowSchema(arrowSchema);
      Schema dataArrowSchema = Utils$.MODULE$.toArrowSchema(dataSchema, "UTC");
      byte[] serializedDataArrowSchema = serializeArrowSchema(dataArrowSchema);

However, we are now seeing that this causes correctness issues or exceptions when the data source is not Parquet:

This epic is for reviewing and discussing Comet's approach to time zones.

Describe the potential solution

No response

Additional context

No response

Activity

  1. added
    enhancement
    on Nov 7, 2025
  2. parthchandra commented on Nov 7, 2025

    @parthchandra
    Contributor

    when the data source is not Parquet:

    when is this true?

  3. andygrove commented on Nov 11, 2025

    @andygrove
    MemberAuthor

    when the data source is not Parquet:

    when is this true?

    For Comet sinks, such as:

    • LocalTableScanExec
    • CometSparkToColumnarExec
    • Exchanges
    • UnionExec
    • CoalesceExec
  4. andygrove commented on Nov 11, 2025

    @andygrove
    MemberAuthor

    Another related timezone issue:

    Cast from string to timestamp:

          case DataTypes.TimestampType if timeZoneId.exists(tz => tz != "UTC") =>
            Incompatible(Some(s"Cast will use UTC instead of $timeZoneId"))
    
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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions