Skip to content

Commit

Permalink
ARROW-3966: Picking up lost change to support null calendars.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Pigott committed Feb 6, 2019
1 parent 7049c36 commit 02f2f34
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,13 @@ public static Schema jdbcToArrowSchema(ResultSetMetaData rsmd, JdbcToArrowConfig
Preconditions.checkNotNull(rsmd, "JDBC ResultSetMetaData object can't be null");
Preconditions.checkNotNull(config, "The configuration object must not be null");

final String timezone;
if (config.getCalendar() != null) {
timezone = config.getCalendar().getTimeZone().getID();
} else {
timezone = null;
}

List<Field> fields = new ArrayList<>();
int columnCount = rsmd.getColumnCount();
for (int i = 1; i <= columnCount; i++) {
Expand Down Expand Up @@ -223,7 +230,7 @@ public static Schema jdbcToArrowSchema(ResultSetMetaData rsmd, JdbcToArrowConfig
fieldType =
new FieldType(
true,
new ArrowType.Timestamp(TimeUnit.MILLISECOND, config.getCalendar().getTimeZone().getID()),
new ArrowType.Timestamp(TimeUnit.MILLISECOND, timezone),
null,
metadata);
break;
Expand Down

0 comments on commit 02f2f34

Please sign in to comment.