liyafan82 commented on a change in pull request #8167:
URL: https://github.com/apache/arrow/pull/8167#discussion_r487014199
##########
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:
It seems different databases have different date ranges. 9999-12-31 is
one frequently used (in MySQL & SQL Server).
https://stackoverflow.com/questions/37138076/get-max-and-min-date-of-java-sql-date
----------------------------------------------------------------
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:
[email protected]