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 b9f256f69bf..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 @@ -348,6 +348,36 @@ public static JdbcConnectionParams extractURLComponents(String uri, Properties i } } + if (!connParams.getSessionVars().containsKey(AUTH_KYUUBI_CLIENT_PRINCIPAL)) { + if (info.containsKey(AUTH_KYUUBI_CLIENT_PRINCIPAL)) { + connParams + .getSessionVars() + .put(AUTH_KYUUBI_CLIENT_PRINCIPAL, info.getProperty(AUTH_KYUUBI_CLIENT_PRINCIPAL)); + } + } + + if (!connParams.getSessionVars().containsKey(AUTH_KYUUBI_CLIENT_KEYTAB)) { + if (info.containsKey(AUTH_KYUUBI_CLIENT_KEYTAB)) { + connParams + .getSessionVars() + .put(AUTH_KYUUBI_CLIENT_KEYTAB, info.getProperty(AUTH_KYUUBI_CLIENT_KEYTAB)); + } + } + + 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)); }