exceptionfactory commented on pull request #4677: URL: https://github.com/apache/nifi/pull/4677#issuecomment-731252957
Looking at the issue in more detail, did you evaluate AvroTypeUtil.convertToAvroObject() and how it handles the LOGICAL_TYPE_DATE? The current implementation converts from java.sql.Date.getTime() to Instant, using Instant.ofEpochMilli() and passes in the milliseconds from java.sql.Date.getTime(). Since java.sql.Date does not include the timezone, the ChronoUnit.DAYS.between() calculation returns a different number of days depending on the JVM timezone. Changing AvroTypeUtil.convertToAvroObject() line 669 to use java.sql.Date.toLocalDate().toEpochDay() results in both tests working without any changes, and appears to operate according to the original intent of the method. ---------------------------------------------------------------- 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]
