asolimando commented on a change in pull request #2685:
URL: https://github.com/apache/hive/pull/2685#discussion_r726828865



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java
##########
@@ -3021,11 +3026,24 @@ private RelNode genTableLogicalPlan(String tableAlias, 
QB qb) throws SemanticExc
 
             DataSource ds = JdbcSchema.dataSource(url, driver, user, pswd);
             SqlDialect jdbcDialect = 
JdbcSchema.createDialect(SqlDialectFactoryImpl.INSTANCE, ds);
+            String dialectName = jdbcDialect.getClass().getName();
             if (LOG.isDebugEnabled()) {
-              LOG.debug("Dialect for table {}: {}", tableName, 
jdbcDialect.getClass().getName());
+              LOG.debug("Dialect for table {}: {}", tableName, dialectName);
+            }
+
+            List<String> jcKey = ImmutableNullableList.of(url, driver, user, 
pswd, dialectName, dataBaseType);
+            if (!jcMap.containsKey(jcKey)) {
+              jcMap.put(jcKey, JdbcConvention.of(jdbcDialect, null, 
dataBaseType));
             }
-            JdbcConvention jc = JdbcConvention.of(jdbcDialect, null, 
dataBaseType);
-            JdbcSchema schema = new JdbcSchema(ds, jc.dialect, jc, 
catalogName, schemaName);
+            JdbcConvention jc = jcMap.get(jcKey);

Review comment:
       Nit: same comment about longer names




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