[
https://issues.apache.org/jira/browse/HIVE-26289?focusedWorklogId=778292&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-778292
]
ASF GitHub Bot logged work on HIVE-26289:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 03/Jun/22 20:27
Start Date: 03/Jun/22 20:27
Worklog Time Spent: 10m
Work Description: zabetak commented on code in PR #3341:
URL: https://github.com/apache/hive/pull/3341#discussion_r889322998
##########
ql/src/java/org/apache/hadoop/hive/ql/io/parquet/read/DataWritableReadSupport.java:
##########
@@ -278,15 +278,7 @@ public static Boolean getWriterDateProleptic(Map<String,
String> metadata) {
return null;
}
String value =
metadata.get(DataWritableWriteSupport.WRITER_DATE_PROLEPTIC);
Review Comment:
Thanks for taking a look @achennagiri .
I don't think we need a try catch for `metadata.get`. It's just a `Map` of
`String` objects so there is no way to throw an exception especially
`DateTimeException`. It seems to be just a bad copy paste from the method above
(`getWriterTimeZoneId`).
Issue Time Tracking
-------------------
Worklog Id: (was: 778292)
Time Spent: 20m (was: 10m)
> Remove useless try catch in DataWritableReadSupport#getWriterDateProleptic
> --------------------------------------------------------------------------
>
> Key: HIVE-26289
> URL: https://issues.apache.org/jira/browse/HIVE-26289
> Project: Hive
> Issue Type: Task
> Components: HiveServer2
> Reporter: Stamatis Zampetakis
> Assignee: Stamatis Zampetakis
> Priority: Trivial
> Labels: pull-request-available
> Time Spent: 20m
> Remaining Estimate: 0h
>
> {code:java}
> try {
> if (value != null) {
> return Boolean.valueOf(value);
> }
> } catch (DateTimeException e) {
> throw new RuntimeException("Can't parse writer proleptic property
> stored in file metadata", e);
> }
> {code}
> The Boolean.valueOf never throws so try catch block is completely useless.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)