[ https://issues.apache.org/jira/browse/HIVE-17730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16200825#comment-16200825 ]
Alexander Kolbasov commented on HIVE-17730: ------------------------------------------- There are several cases in the code: 1) Users of existing QueryWrapper 2) Code that uses Query, but cals rollbackAndCleanup to close it 3) Code that calls (or doesn't) query.closeAll() This patch converts *all* uses of Query in ObjectStore to auto-closeable use that guarantees that it is closed always closed. Note that after collection query close we can't call size() on it, so in such cases query is copied to another collection. As part of the patch I also cleaned up various small things that don't warrant individual JIRAs. > Queries can be closed automatically > ----------------------------------- > > Key: HIVE-17730 > URL: https://issues.apache.org/jira/browse/HIVE-17730 > Project: Hive > Issue Type: Bug > Reporter: Alexander Kolbasov > Assignee: Alexander Kolbasov > Attachments: HIVE-17730.01.patch, HIVE-17730.02.patch > > > HIVE-16213 made QueryWrapper AutoCloseable, but queries are still closed > manually and not by using try-with-resource. And now Query itself is auto > closeable, so we don't need the wrapper at all. > So we should get rid of QueryWrapper and use try-with-resource to create > queries. -- This message was sent by Atlassian JIRA (v6.4.14#64029)