Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-5446

Support TIMESTAMP WITH LOCAL TIME ZONE type in JDBC driver

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • avatica

    Description

      Support TIMESTAMP WITH LOCAL TIME ZONE type in JDBC driver.

      Currently, Calcite types with SqlTypeName.TIMESTAMP_WITH_LOCAL_TIME_ZONE are mapped to JDBC type 1111 (OTHER). As a result, the ResultSet.toString() method just converts the (signed) long value to a string.

      Here is what Progress says:

      The Oracle TIMESTAMP WITH LOCAL TIME ZONE data type is mapped to the JDBC TIMESTAMP data type.

      When retrieving TIMESTAMP WITH LOCAL TIME ZONE columns, the value returned to the user is converted to the time zone specified by the TIME_ZONE session parameter.

      When setting TIMESTAMP WITH LOCAL TIME ZONE columns:

      • Using a timestamp (using PreparedStatement.setTimestamp, for example), the value set is converted to the time zone specified by the TIME_ZONE session parameter.
      • Using a string (using PreparedStatement.setString(), for example), the string is passed as-is to the server. The supplied string must be in the format specified by the NLS_TIMESTAMP_TZ_FORMAT session parameter. If not, the Oracle server generates an error when it attempts to convert the string to the TIMESTAMP WITH LOCAL TIME ZONE type.

      We should definitely map to java.sql.Types.TIMESTAMP.

      I'm not sure whether Calcite has a TIME_ZONE session parameter. But values should be shifted from/to the desired time zone on the way in/out.

      And maybe there should also be a Calcite server time zone that is the time zone in which TIMESTAMP WITH LOCAL TIME ZONE values are represented. By default this should be UTC, and using a time zone with a variable offset from UTC (e.g. "Pacific/Los_Angeles") would be a bad idea.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              julianhyde Julian Hyde
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 5h 40m
                  5h 40m