You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "wgtmac (via GitHub)" <gi...@apache.org> on 2023/04/14 16:30:47 UTC

[GitHub] [arrow] wgtmac opened a new issue, #35138: [Java] ArrowFlightJdbcTimeStampVectorAccessor does not deal with calendar correctly

wgtmac opened a new issue, #35138:
URL: https://github.com/apache/arrow/issues/35138

   ### Describe the bug, including details regarding any error messages, version, and platform.
   
   The piece of code below in the `class ArrowFlightJdbcTimeStampVectorAccessor` does not deal with timezone correctly.
   
   ```java
     private LocalDateTime getLocalDateTime(Calendar calendar) {
       getter.get(getCurrentRow(), holder);
       this.wasNull = holder.isSet == 0;
       this.wasNullConsumer.setWasNull(this.wasNull);
       if (this.wasNull) {
         return null;
       }
   
       long value = holder.value;
   
       LocalDateTime localDateTime = this.longToLocalDateTime.fromLong(value);
   
       if (calendar != null) {
         TimeZone timeZone = calendar.getTimeZone();
         long millis = this.timeUnit.toMillis(value);
         localDateTime = localDateTime
             .minus(timeZone.getOffset(millis) - this.timeZone.getOffset(millis), ChronoUnit.MILLIS);
       }
       return localDateTime;
     }
   ```
   
   It should call `localDateTime.plus` instead of `localDateTime.minus`.
   
   I hit this issue when integrating this into our own JDBC implementation and found that the timestamp string in the `ResultSet` is wrong when converting between timezones.
   
   ### Component(s)
   
   Java


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] wgtmac closed issue #35138: [Java] ArrowFlightJdbcTimeStampVectorAccessor does not deal with calendar correctly

Posted by "wgtmac (via GitHub)" <gi...@apache.org>.
wgtmac closed issue #35138: [Java] ArrowFlightJdbcTimeStampVectorAccessor does not deal with calendar correctly
URL: https://github.com/apache/arrow/issues/35138


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org