wgtmac commented on code in PR #35139:
URL: https://github.com/apache/arrow/pull/35139#discussion_r1167542371
##########
java/flight/flight-sql-jdbc-core/src/test/java/org/apache/arrow/driver/jdbc/accessor/impl/text/ArrowFlightJdbcVarCharVectorAccessorTest.java:
##########
@@ -510,14 +510,23 @@ public void
testShouldGetDateReturnValidDateWithCalendar() throws Exception {
Text value = new Text("2021-07-02");
when(getter.get(0)).thenReturn(value.copyBytes());
- Calendar calendar =
Calendar.getInstance(TimeZone.getTimeZone("America/Sao_Paulo"));
- Date result = accessor.getDate(calendar);
+ {
+ Calendar calendar =
Calendar.getInstance(TimeZone.getTimeZone("America/Sao_Paulo"));
+ Date result = accessor.getDate(calendar);
+ calendar.setTime(result);
- calendar = Calendar.getInstance(TimeZone.getTimeZone("Etc/UTC"));
- calendar.setTime(result);
+ collector.checkThat(dateTimeFormat.format(calendar.getTime()),
+ equalTo("2021-07-01T21:00:00.000Z"));
Review Comment:
Here is the code where it assumes UTC if timezone is missing from the
vector:
https://github.com/apache/arrow/blob/eaa1a1ea74e2b37020e0133f1460cb251e5f4974/java/flight/flight-sql-jdbc-core/src/main/java/org/apache/arrow/driver/jdbc/accessor/impl/calendar/ArrowFlightJdbcTimeStampVectorAccessor.java#L180
Yes, I agree with you that we shouldn't blindly assume timezone to be UTC if
unset. In Apache Hive, this usually means timestamp without timezone where the
values are assumed to be in the default timezone in the JVM (which is the local
timezone in the usual case).
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]