From 7de8d7d02e455843f2b587c8f1284be34a6dfbfa Mon Sep 17 00:00:00 2001 From: madlnu Date: Mon, 30 Sep 2024 01:24:22 +0530 Subject: [PATCH] Adding server principal and principal --- .../java/org/apache/kyuubi/jdbc/hive/Utils.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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)); }