Skip to content

[Flight SQL JDBC] Timestamp time zones given as an offset are read as GMT, and an empty time zone is treated as a time zone #1548

In review

Description

@jbonofre

Describe the bug, including details regarding any error messages, version, and platform.

Follow-up to #1542. The Flight SQL JDBC driver reads the time zone of an Arrow Timestamp differently from the way it binds parameters since #1542, and it handles two of the forms the Arrow format allows incorrectly:

  1. Offset time zones. The format allows a time zone given as an offset, of the form +XX:XX or -XX:XX. ArrowFlightJdbcTimeStampVectorAccessor.getTimeZoneForVector parses the time zone with TimeZone.getTimeZone, which returns GMT for any name it doesn't know, including +03:00, -05:30 and +0300. For a Timestamp(MILLISECOND, "+03:00") value of 2024-03-15T09:00:00Z:

    • getObject(LocalDateTime.class) and getTimestamp return 09:00 instead of 12:00.
    • getObject(OffsetDateTime.class) returns 09:00Z instead of 12:00+03:00.

    TimestampAvaticaParameterConverter parses the offset correctly, so a LocalDateTime bound with setObject to such a parameter is read back shifted by the offset.

  2. Empty time zone. The format treats an empty time zone like an unset one ("Timestamps with an unset / empty timezone"), and SqlTypes already reports such a column as TIMESTAMP, not TIMESTAMP_WITH_TIMEZONE. But:

    • the accessor treats "" as a time zone (GMT), so getObject(Instant.class), getObject(OffsetDateTime.class) and getObject(ZonedDateTime.class) are accepted, while they are rejected for a column without a time zone;
    • setObject(i, LocalDateTime) on a Timestamp(unit, "") parameter fails with DateTimeException: Invalid ID for ZoneOffset, invalid format:.

Expected: an offset time zone is applied when reading, so a bound LocalDateTime reads back unchanged, and an empty time zone behaves like no time zone, both when reading and when binding.

Activity

  1. added
    Type: bug
    on Dec 3, 2026
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

    Type: bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions