You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2021/06/09 17:13:30 UTC

[GitHub] [hive] belugabehr commented on a change in pull request #2344: HIVE-23633: (addendum) Metastore some JDO query objects do not close …

belugabehr commented on a change in pull request #2344:
URL: https://github.com/apache/hive/pull/2344#discussion_r648509685



##########
File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java
##########
@@ -914,6 +914,7 @@ private boolean isViewTable(String catName, String dbName, String tblName) throw
     long queryTime = doTrace ? System.nanoTime() : 0;
     MetastoreDirectSqlUtils.timingTrace(doTrace, queryText, start, queryTime);
     if (sqlResult.isEmpty()) {
+      query.closeAll();
       return Collections.emptyList(); // no partitions, bail early.
     }

Review comment:
       Can you just remove this entire block?  This will allow for a single return statement at the bottom and also allows the cleanup to happen.

##########
File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java
##########
@@ -1453,6 +1454,7 @@ public ColumnStatistics getTableStats(final String catName, final String dbName,
     };
     List<Object[]> list = Batchable.runBatched(batchSize, colNames, b);
     if (list.isEmpty()) {
+      b.closeAllQueries();
       return null;
     }

Review comment:
       Same here....
   
   ```java
       List<Object[]> list = Batchable.runBatched(batchSize, colNames, b);
       final ColumnStatistics result;
       if (list.isEmpty()) {
           result = null;
       } else {
          ColumnStatisticsDesc csd = new ColumnStatisticsDesc(true, dbName, tableName);
          csd.setCatName(catName);
          result = makeColumnStats(list, csd, 0, engine);
       }
       b.closeAllQueries();
       return result;
     }
   ```




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org