deniskuzZ commented on code in PR #6412:
URL: https://github.com/apache/hive/pull/6412#discussion_r3637306198


##########
itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcDriver2.java:
##########
@@ -349,13 +419,13 @@ public void testURLWithFetchSize() throws SQLException {
    * @throws SQLException
    */
   public void testCreateTableAsExternal() throws SQLException {
-    Connection con = getConnection(testDbName + 
";hiveCreateAsExternalLegacy=true", "");
-    Statement stmt = con.createStatement();
+    Connection connectionWithExternalLegacy = getConnection(testDbName + 
";hiveCreateAsExternalLegacy=true", "");
+    Statement stmt = connectionWithExternalLegacy.createStatement();
     ResultSet res = stmt.executeQuery("set hive.create.as.external.legacy");
     assertTrue("ResultSet is empty", res.next());
     assertEquals("hive.create.as.external.legacy=true", res.getObject(1));
     stmt.close();
-    con.close();
+    connectionWithExternalLegacy.close();

Review Comment:
   ````
   try (Connection connection =
            getConnection(testDbName + ";hiveCreateAsExternalLegacy=true", "");
        Statement stmt = connection.createStatement();
        ResultSet res = stmt.executeQuery("set 
hive.create.as.external.legacy")) {
       ....
   }
   ````



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to