You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/09/11 12:26:20 UTC

[GitHub] [arrow] pwoody commented on a change in pull request #8167: ARROW-9973: [Java] JDBC DateConsumer does not allow dates before epoch

pwoody commented on a change in pull request #8167:
URL: https://github.com/apache/arrow/pull/8167#discussion_r487010013



##########
File path: java/adapter/jdbc/src/main/java/org/apache/arrow/adapter/jdbc/consumer/DateConsumer.java
##########
@@ -85,13 +85,13 @@ public void consume(ResultSet resultSet) throws SQLException {
       Date date = calendar == null ? resultSet.getDate(columnIndexInResultSet) :
           resultSet.getDate(columnIndexInResultSet, calendar);
       if (!resultSet.wasNull()) {
-        int day = (int) TimeUnit.MILLISECONDS.toDays(date.getTime());
-        if (day < 0 || day > MAX_DAY) {
+        long day = TimeUnit.MILLISECONDS.toDays(date.getTime());
+        if (day < Integer.MIN_VALUE || day > MAX_DAY) {

Review comment:
       Is there context as to why the date range of -9999-12-31 to 9999-12-31? I hadn't seen it in the format spec.




----------------------------------------------------------------
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.

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