From 0f2458375d6a5310956fa347e0ad42b53f76cca8 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 | 16 ++++++++++++++++ 1 file changed, 16 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..6c2a44c82c4 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,22 @@ 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)); }