leesf commented on a change in pull request #868: HUDI-180 : Adding support for 
hive registration using metastore along with JDBC
URL: https://github.com/apache/incubator-hudi/pull/868#discussion_r319738852
 
 

 ##########
 File path: hudi-hive/src/main/java/org/apache/hudi/hive/HoodieHiveClient.java
 ##########
 @@ -116,6 +126,19 @@ public HoodieHiveClient(HiveSyncConfig cfg, HiveConf 
configuration, FileSystem f
     activeTimeline = 
metaClient.getActiveTimeline().getCommitsTimeline().filterCompletedInstants();
   }
 
+  private static void closeQuietly(ResultSet resultSet, Statement stmt) {
+    try {
+      if (stmt != null) {
+        stmt.close();
+      }
+      if (resultSet != null) {
+        resultSet.close();
+      }
+    } catch (SQLException e) {
 
 Review comment:
   If stmt.close() throws SQLException. the resultSet would not be closed. 
Could it be the following?
   ```
   try {
         if (stmt != null) {
           stmt.close();
         }
   } catch (SQLException e) {
        // log
   }
   
   try {
         if (resultSet != null) {
           resultSet.close();
         }
   } catch (SQLException e) {
        // log
   }
   ```

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to