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/10/28 21:31:10 UTC

[GitHub] [hive] cravani commented on a change in pull request #2734: HIVE-25626: JDBCStorageHandler CBO fails when JDBC_PASSWORD_URI is used

cravani commented on a change in pull request #2734:
URL: https://github.com/apache/hive/pull/2734#discussion_r738789344



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java
##########
@@ -3011,9 +3011,14 @@ private RelNode genTableLogicalPlan(String tableAlias, QB qb) throws SemanticExc
             final String user = tabMetaData.getProperty(Constants.JDBC_USERNAME);
             String pswd = tabMetaData.getProperty(Constants.JDBC_PASSWORD);
             if (pswd == null) {
-              String keystore = tabMetaData.getProperty(Constants.JDBC_KEYSTORE);
-              String key = tabMetaData.getProperty(Constants.JDBC_KEY);
-              pswd = Utilities.getPasswdFromKeystore(keystore, key);
+              if(!(tabMetaData.getProperty(Constants.JDBC_PASSWORD_URI) == null)) {
+                  pswd = Utilities.getPasswdFromUri(tabMetaData.getProperty(Constants.JDBC_PASSWORD_URI));
+              }
+              else {
+                String keystore = tabMetaData.getProperty(Constants.JDBC_KEYSTORE);
+                String key = tabMetaData.getProperty(Constants.JDBC_KEY);
+                pswd = Utilities.getPasswdFromKeystore(keystore, key);
+              }

Review comment:
       @zabetak Thank you for the comments, problem with final string would lead to compilation error if used in el else block.
   Modified patch a bit and submitted a PR again.
   
   Test case is sill pending, would it be Ok if I write a test case post HIVE-25594 gets pushed? maybe another Jira?




-- 
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: gitbox-unsubscribe@hive.apache.org

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