zabetak commented on code in PR #4170:
URL: https://github.com/apache/hive/pull/4170#discussion_r1168643738
##########
common/src/java/org/apache/hive/common/util/TimestampParser.java:
##########
@@ -199,6 +205,19 @@ public Timestamp parseTimestamp(final String text) {
}
+ public TimestampTZ parseTimestamp(String text, ZoneId defaultTimeZone) {
+ Objects.requireNonNull(text);
+ for (DateTimeFormatter f : dtFormatters) {
+ try {
+ return TimestampTZUtil.parse(text, defaultTimeZone, f);
+ } catch (DateTimeException e) {
Review Comment:
The `catch` is used to capture the `DateTimeException` and restrain/ignore
it. Without the `catch` the exception will propagate which is not what we want
here; the intention is to try all available parsers till we find one that can
parse the value or till we run out of options.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]