aiguofer commented on code in PR #464:
URL: https://github.com/apache/arrow-java/pull/464#discussion_r1976775321


##########
flight/flight-sql-jdbc-core/src/test/java/org/apache/arrow/driver/jdbc/accessor/impl/calendar/ArrowFlightJdbcTimeStampVectorAccessorTest.java:
##########
@@ -320,6 +404,24 @@ private Timestamp getTimestampForVector(int currentRow, 
String timeZone) {
     return expectedTimestamp;
   }
 
+  private ZonedDateTime getZonedDateTime(int currentRow, String timeZone) {
+    Object object = vector.getObject(currentRow);
+    TimeZone tz = TimeZone.getTimeZone(timeZone);
+    ZonedDateTime expectedTimestamp = null;
+    if (object instanceof LocalDateTime) {
+      expectedTimestamp = ((LocalDateTime) object).atZone(tz.toZoneId());
+    } else if (object instanceof Long) {
+      TimeUnit timeUnit = getTimeUnitForVector(vector);
+      long millis = timeUnit.toMillis((Long) object);
+      long offset = tz.getOffset(millis);
+      // TODO: should we actually add the offset here? I'm not completely sure 
how the value is
+      // stored in the vector
+      LocalDateTime local = new Timestamp(millis + offset).toLocalDateTime();

Review Comment:
   I'm not entirely sure about this part. I'm assuming that the Long stored in 
the vector is the Epoch value, so we do need to adjust for the given TZ.



-- 
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: github-unsubscr...@arrow.apache.org

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

Reply via email to