This is an automated email from the ASF dual-hosted git repository.

zjffdu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/zeppelin.git


The following commit(s) were added to refs/heads/master by this push:
     new 46ae9156ea [ZEPPELIN-5694] Support apache kyuubi (#4392)
46ae9156ea is described below

commit 46ae9156ea14ea1a697d52407a677eedaa038ef5
Author: Guanhua Li <[email protected]>
AuthorDate: Sat Sep 24 11:16:01 2022 +0800

    [ZEPPELIN-5694] Support apache kyuubi (#4392)
    
    * [ZEPPELIN-5694] Support apache kyuubi
    
    * SUPPORT KERBEROS MODE
---
 docs/interpreter/jdbc.md                           | 100 ++++++++++++++++++++-
 docs/quickstart/sql_with_zeppelin.md               |   1 +
 .../org/apache/zeppelin/jdbc/JDBCInterpreter.java  |   5 +-
 3 files changed, 104 insertions(+), 2 deletions(-)

diff --git a/docs/interpreter/jdbc.md b/docs/interpreter/jdbc.md
index c21c661bbc..a94f7bde4d 100644
--- a/docs/interpreter/jdbc.md
+++ b/docs/interpreter/jdbc.md
@@ -162,7 +162,7 @@ The last step is **Dependency Setting**. Since Zeppelin 
only includes `PostgreSQ
 
 <img 
src="{{BASE_PATH}}/assets/themes/zeppelin/img/docs-img/edit_dependencies.png" 
width="600px" />
 
-That's it. You can find more JDBC connection setting examples([Mysql](#mysql), 
[MariaDB](#mariadb), [Redshift](#redshift), [Apache Hive](#apache-hive), 
[Presto/Trino](#prestotrino), [Impala](#impala), [Apache 
Phoenix](#apache-phoenix), and [Apache Tajo](#apache-tajo)) in [this 
section](#examples).
+That's it. You can find more JDBC connection setting examples([Mysql](#mysql), 
[MariaDB](#mariadb), [Redshift](#redshift), [Apache Hive](#apache-hive), 
[Presto/Trino](#prestotrino), [Impala](#impala), [Apache Kyuubi 
(Incubating)](#apache-kyuubi-(incubating)), [Apache Phoenix](#apache-phoenix), 
and [Apache Tajo](#apache-tajo)) in [this section](#examples).
 
 ## JDBC Interpreter Datasource Pool Configuration
 The Jdbc interpreter uses the connection pool technology, and supports users 
to do some personal configuration of the connection pool. For example, we can 
configure `default.validationQuery='select 1'` and `default.testOnBorrow=true` 
in the Interpreter configuration to avoid the "Invalid SessionHandle" runtime 
error caused by Session timeout when connecting to HiveServer2 through JDBC 
interpreter.
@@ -827,6 +827,104 @@ Dependencies
   </tr>
 </table>
 
+### Apache Kyuubi (Incubating)
+
+Zeppelin connect to `Kyuubi` to run sql via `KyuubiHiveDriver`. There are 2 
cases of connecting with Kyuubi:
+
+* Connect to Kyuubi without KERBEROS
+* Connect to Kyuubi with KERBEROS
+
+Each case requires different settings.
+
+##### Connect to Kyuubi without KERBEROS
+
+In this scenario, you need to make the following settings at least. Kyuubi 
engine run as user of `default.user`.
+
+Properties
+
+<table class="table-configuration">
+  <tr>
+    <th>Name</th>
+    <th>Value</th>
+  </tr>
+  <tr>
+    <td>default.driver</td>
+    <td>org.apache.kyuubi.jdbc.KyuubiHiveDriver</td>
+  </tr>
+  <tr>
+    <td>default.url</td>
+    <td>jdbc:hive2://kyuubi-server:10009</td>
+  </tr>
+</table>
+
+Dependencies
+
+<table class="table-configuration">
+  <tr>
+    <th>Artifact</th>
+    <th>Excludes</th>
+  </tr>
+  <tr>
+    <td>org.apache.kyuubi:kyuubi-hive-jdbc-shaded:1.5.2-incubating</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>org.apache.hive:hive-jdbc:3.1.2</td>
+    <td></td>
+  </tr>
+</table>
+
+
+##### Connect to Kyuubi with KERBEROS
+
+In this scenario, you need to make the following settings at least. Kyuubi 
engine run as user of client principal (`zeppelin.jdbc.principal`).
+
+Properties
+
+<table class="table-configuration">
+  <tr>
+    <th>Name</th>
+    <th>Value</th>
+  </tr>
+  <tr>
+    <td>default.driver</td>
+    <td>org.apache.kyuubi.jdbc.KyuubiHiveDriver</td>
+  </tr>
+  <tr>
+    <td>default.url</td>
+    
<td>jdbc:hive2://kyuubi-server:10009/default;principal={kyuubi_principal}</td>
+  </tr>
+  <tr>
+    <td>zeppelin.jdbc.auth.type</td>
+    <td>KERBEROS</td>
+  </tr>
+  <tr>
+    <td>zeppelin.jdbc.keytab.location</td>
+    <td>keytab of client</td>
+  </tr>
+  <tr>
+    <td>zeppelin.jdbc.principal</td>
+    <td>principal of client</td>
+  </tr>
+</table>
+
+Dependencies
+
+<table class="table-configuration">
+  <tr>
+    <th>Artifact</th>
+    <th>Excludes</th>
+  </tr>
+  <tr>
+    <td>org.apache.kyuubi:kyuubi-hive-jdbc-shaded:1.5.2-incubating</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>org.apache.hive:hive-jdbc:3.1.2</td>
+    <td></td>
+  </tr>
+</table>
+
 ### Apache Phoenix
 
 Phoenix supports `thick` and `thin` connection types:
diff --git a/docs/quickstart/sql_with_zeppelin.md 
b/docs/quickstart/sql_with_zeppelin.md
index 2f04478020..b2c3beb651 100644
--- a/docs/quickstart/sql_with_zeppelin.md
+++ b/docs/quickstart/sql_with_zeppelin.md
@@ -35,6 +35,7 @@ The following guides explain how to use Apache Zeppelin that 
enables you to writ
   * [Apache Hive](../interpreter/jdbc.html#apache-hive)
   * [Presto/Trino](../interpreter/jdbc.html#prestotrino)
   * [Impala](../interpreter/jdbc.html#impala)
+  * [Apache Kyuubi 
(Incubating)](../interpreter/jdbc.html#apache-kyuubi-incubating)
   * [Apache Phoenix](../interpreter/jdbc.html#apache-phoenix) 
   * [Apache Drill](../interpreter/jdbc.html#apache-drill)
   * [Apache Tajo](../interpreter/jdbc.html#apache-tajo)
diff --git a/jdbc/src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java 
b/jdbc/src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java
index f5302dc48a..705ad19192 100644
--- a/jdbc/src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java
+++ b/jdbc/src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java
@@ -805,7 +805,10 @@ public class JDBCInterpreter extends KerberosInterpreter {
 
           // start hive monitor thread if it is hive jdbc
           String jdbcURL = 
getJDBCConfiguration(user).getPropertyMap(dbPrefix).getProperty(URL_KEY);
-          if (jdbcURL != null && jdbcURL.startsWith("jdbc:hive2://")) {
+          String driver =
+                  
getJDBCConfiguration(user).getPropertyMap(dbPrefix).getProperty(DRIVER_KEY);
+          if (jdbcURL != null && jdbcURL.startsWith("jdbc:hive2://")
+                  && driver != null && 
driver.equals("org.apache.hive.jdbc.HiveDriver")) {
             HiveUtils.startHiveMonitorThread(statement, context,
                     Boolean.parseBoolean(getProperty("hive.log.display", 
"true")), this);
           }

Reply via email to