dongjoon-hyun commented on a change in pull request #743:
URL: https://github.com/apache/orc/pull/743#discussion_r689639185
##########
File path: java/core/src/java/org/apache/orc/impl/ConvertTreeReaderFactory.java
##########
@@ -962,7 +963,10 @@ public void setConvertVectorElement(int elementNum) throws
IOException {
seconds += 1;
nanos = 1_000_000_000 - nanos;
}
- HiveDecimal value = HiveDecimal.create(String.format("%d.%09d", seconds,
nanos));
+ BigDecimal secondsBd = new BigDecimal(seconds);
+ BigDecimal nanosBd = new BigDecimal(nanos).movePointLeft(9);
+ BigDecimal resultBd = (seconds >= 0L) ? secondsBd.add(nanosBd) :
secondsBd.subtract(nanosBd);
Review comment:
Do you have a test coverage for this negative second case? If we don't
have, could you make one please?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]