[
https://issues.apache.org/jira/browse/HIVE-24811?focusedWorklogId=556356&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-556356
]
ASF GitHub Bot logged work on HIVE-24811:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 23/Feb/21 14:30
Start Date: 23/Feb/21 14:30
Worklog Time Spent: 10m
Work Description: 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]
Issue Time Tracking
-------------------
Worklog Id: (was: 556356)
Time Spent: 20m (was: 10m)
> Extend Cached Dates to Other Areas
> ----------------------------------
>
> Key: HIVE-24811
> URL: https://issues.apache.org/jira/browse/HIVE-24811
> Project: Hive
> Issue Type: Improvement
> Reporter: David Mollitor
> Assignee: David Mollitor
> Priority: Minor
> Labels: pull-request-available
> Time Spent: 20m
> Remaining Estimate: 0h
>
> Based on my work on [HIVE-24808], I noticed other places that call
> {{Date#valueOf}} that can probably also benefit from using a cache mechanism.
> Locate those places and change calls to use the {{Parser}} cache.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)