Skip to content

Commit 02f2f34

Browse files
author
Mike Pigott
committed
ARROW-3966: Picking up lost change to support null calendars.
1 parent 7049c36 commit 02f2f34

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

java/adapter/jdbc/src/main/java/org/apache/arrow/adapter/jdbc/JdbcToArrowUtils.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,13 @@ public static Schema jdbcToArrowSchema(ResultSetMetaData rsmd, JdbcToArrowConfig
156156
Preconditions.checkNotNull(rsmd, "JDBC ResultSetMetaData object can't be null");
157157
Preconditions.checkNotNull(config, "The configuration object must not be null");
158158

159+
final String timezone;
160+
if (config.getCalendar() != null) {
161+
timezone = config.getCalendar().getTimeZone().getID();
162+
} else {
163+
timezone = null;
164+
}
165+
159166
List<Field> fields = new ArrayList<>();
160167
int columnCount = rsmd.getColumnCount();
161168
for (int i = 1; i <= columnCount; i++) {
@@ -223,7 +230,7 @@ public static Schema jdbcToArrowSchema(ResultSetMetaData rsmd, JdbcToArrowConfig
223230
fieldType =
224231
new FieldType(
225232
true,
226-
new ArrowType.Timestamp(TimeUnit.MILLISECOND, config.getCalendar().getTimeZone().getID()),
233+
new ArrowType.Timestamp(TimeUnit.MILLISECOND, timezone),
227234
null,
228235
metadata);
229236
break;

0 commit comments

Comments
 (0)