belugabehr commented on a change in pull request #2007:
URL: https://github.com/apache/hive/pull/2007#discussion_r581082406
##########
File path:
common/src/java/org/apache/hadoop/hive/common/type/TimestampUtils.java
##########
@@ -176,7 +177,7 @@ public static Timestamp stringToTimestamp(String s) {
// Handle simpler cases directly avoiding exceptions
if (s.length() == DATE_LENGTH) {
// Its a date!
- return Timestamp.ofEpochMilli(Date.valueOf(s).toEpochMilli());
+ return Timestamp.ofEpochMilli(DateParser.parseDate(s).toEpochMilli());
Review comment:
So, this one is a little weird. Previously, `Date.valueOf` could
potentially throw an `IllegalArgumentException` if the string was invalid,
contrary to the comment:
> Handle simpler cases directly avoiding exceptions
Now, it could throw a NPE as DateParser returns `null` on invalid input.
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]