diff --git a/kyuubi-hive-jdbc/src/main/java/org/apache/kyuubi/jdbc/hive/Utils.java b/kyuubi-hive-jdbc/src/main/java/org/apache/kyuubi/jdbc/hive/Utils.java index 9166c86a430..633c21e6595 100644 --- a/kyuubi-hive-jdbc/src/main/java/org/apache/kyuubi/jdbc/hive/Utils.java +++ b/kyuubi-hive-jdbc/src/main/java/org/apache/kyuubi/jdbc/hive/Utils.java @@ -364,6 +364,20 @@ public static JdbcConnectionParams extractURLComponents(String uri, Properties i } } + if (!connParams.getSessionVars().containsKey(AUTH_KYUUBI_SERVER_PRINCIPAL)) { + if (info.containsKey(AUTH_KYUUBI_SERVER_PRINCIPAL)) { + connParams + .getSessionVars() + .put(AUTH_KYUUBI_SERVER_PRINCIPAL, info.getProperty(AUTH_KYUUBI_SERVER_PRINCIPAL)); + } + } + + if (!connParams.getSessionVars().containsKey(AUTH_PRINCIPAL)) { + if (info.containsKey(AUTH_PRINCIPAL)) { + connParams.getSessionVars().put(AUTH_PRINCIPAL, info.getProperty(AUTH_PRINCIPAL)); + } + } + if (info.containsKey(AUTH_TYPE)) { connParams.getSessionVars().put(AUTH_TYPE, info.getProperty(AUTH_TYPE)); }