You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Zoltan Haindrich (Jira)" <ji...@apache.org> on 2021/01/25 13:04:00 UTC
[jira] [Updated] (HIVE-22981) DataFileReader is not closed in
AvroGenericRecordReader#extractWriterTimezoneFromMetadata
[ https://issues.apache.org/jira/browse/HIVE-22981?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Zoltan Haindrich updated HIVE-22981:
------------------------------------
Fix Version/s: 3.2.0
3.1.3
This patch have been ported to branch-3 - thank you Ćukasz Osipiuk!
> DataFileReader is not closed in AvroGenericRecordReader#extractWriterTimezoneFromMetadata
> -----------------------------------------------------------------------------------------
>
> Key: HIVE-22981
> URL: https://issues.apache.org/jira/browse/HIVE-22981
> Project: Hive
> Issue Type: Bug
> Reporter: Karen Coppage
> Assignee: Karen Coppage
> Priority: Major
> Labels: pull-request-available
> Fix For: 3.1.3, 3.2.0, 4.0.0
>
> Attachments: HIVE-22981.01.patch
>
> Time Spent: 1h
> Remaining Estimate: 0h
>
> Method looks like :
> {code}
> private ZoneId extractWriterTimezoneFromMetadata(JobConf job, FileSplit split,
> GenericDatumReader<GenericRecord> gdr) throws IOException {
> if (job == null || gdr == null || split == null || split.getPath() == null) {
> return null;
> }
> try {
> DataFileReader<GenericRecord> dataFileReader =
> new DataFileReader<GenericRecord>(new FsInput(split.getPath(), job), gdr);
> [...return...]
> }
> } catch (IOException e) {
> // Can't access metadata, carry on.
> }
> return null;
> }
> {code}
> The DataFileReader is never closed which can cause a memory leak. We need a try-with-resources here.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)