Skip to content

Commit 659d981

Browse files
zwangshengulysses-you
authored andcommitted
[KYUUBI #2337] [DOCS] Access Kyuubi with Kyuubi JDBC Driver
### _Why are the changes needed?_ Access Kyuubi with Kyuubi-Hive-JDBC Documentation is missing Close #2337 ### _How was this patch tested?_ - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible - [x] Add screenshots for manual tests if appropriate - [ ] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request Closes #2339 from zwangsheng/ISSUE/#2337. Closes #2337 d4154e6 [zwangsheng] fix mvn url 510708c [zwangsheng] fix c4bb936 [zwangsheng] KYUUBI-2337 Authored-by: zwangsheng <2213335496@qq.com> Signed-off-by: ulysses-you <ulyssesyou@apache.org>
1 parent 8a525e5 commit 659d981

File tree

2 files changed

+102
-0
lines changed

2 files changed

+102
-0
lines changed

docs/client/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@ Client Documentation
2424
:numbered: 2
2525

2626
hive_jdbc
27+
kyuubi_jdbc
2728
kerberized_kyuubi

docs/client/kyuubi_jdbc.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
<!--
2+
- Licensed to the Apache Software Foundation (ASF) under one or more
3+
- contributor license agreements. See the NOTICE file distributed with
4+
- this work for additional information regarding copyright ownership.
5+
- The ASF licenses this file to You under the Apache License, Version 2.0
6+
- (the "License"); you may not use this file except in compliance with
7+
- the License. You may obtain a copy of the License at
8+
-
9+
- http://www.apache.org/licenses/LICENSE-2.0
10+
-
11+
- Unless required by applicable law or agreed to in writing, software
12+
- distributed under the License is distributed on an "AS IS" BASIS,
13+
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
- See the License for the specific language governing permissions and
15+
- limitations under the License.
16+
-->
17+
18+
<div align=center>
19+
20+
![](../imgs/kyuubi_logo.png)
21+
22+
</div>
23+
24+
# Access Kyuubi with Kyuubi JDBC Drivers
25+
26+
## Install Kyuubi JDBC
27+
28+
For programing, the easiest way to get `kyuubi-hive-jdbc-shaded` is from [the maven central](https://mvnrepository.com/artifact/org.apache.kyuubi/kyuubi-hive-jdbc-shaded). For example,
29+
30+
- **maven**
31+
```xml
32+
<dependency>
33+
<groupId>org.apache.kyuubi</groupId>
34+
<artifactId>kyuubi-hive-jdbc-shaded</artifactId>
35+
<version>1.5.0-incubating</version>
36+
</dependency>
37+
```
38+
39+
- **sbt**
40+
```scala
41+
libraryDependencies += "org.apache.kyuubi" % "kyuubi-hive-jdbc-shaded" % "1.5.0-incubating"
42+
```
43+
44+
- **gradle**
45+
```gradle
46+
implementation group: 'org.apache.kyuubi', name: 'kyuubi-hive-jdbc-shaded', version: '1.5.0-incubating'
47+
```
48+
49+
For BI tools, please refer to [Quick Start](../quick_start/index.html) to check the guide for the BI tool used.
50+
If you find there is no specific document for the BI tool that you are using, don't worry, the configuration part for all BI tools are basically the same.
51+
Also, we will appreciate if you can help us to improve the document.
52+
53+
## JDBC URL
54+
55+
JDBC URLs have the following format:
56+
57+
```
58+
jdbc:hive2://<host>:<port>/<dbName>;<sessionVars>?<kyuubiConfs>#<[spark|hive]Vars>
59+
```
60+
61+
JDBC Parameter | Description
62+
---------------| -----------
63+
host | The cluster node hosting Kyuubi Server.
64+
port | The port number to which is Kyuubi Server listening.
65+
dbName | Optional database name to set the current database to run the query against, use `default` if absent.
66+
sessionVars | Optional `Semicolon(;)` separated `key=value` parameters for the JDBC/ODBC driver. Such as `user`, `password` and `hive.server2.proxy.user`.
67+
kyuubiConfs | Optional `Semicolon(;)` separated `key=value` parameters for Kyuubi server to create the corresponding engine, dismissed if engine exists.
68+
[spark&#124;hive]Vars | Optional `Semicolon(;)` separated `key=value` parameters for Spark/Hive variables used for variable substitution.
69+
70+
## Example
71+
72+
```
73+
jdbc:hive2://localhost:10009/default;hive.server2.proxy.user=proxy_user?kyuubi.engine.share.level=CONNECTION;spark.ui.enabled=false#var_x=y
74+
```
75+
76+
## Alert
77+
78+
If you already have `hadoop-common` dependency in your classpath, you should exclude `hadoop-client-api` from `kyuubi-hive-jdbc-shaded` to avoid class confliction. For example:
79+
80+
- **maven**
81+
```xml
82+
<dependency>
83+
<groupId>org.apache.kyuubi</groupId>
84+
<artifactId>kyuubi-hive-jdbc-shaded</artifactId>
85+
<version>1.5.0-incubating</version>
86+
<exclusion>
87+
<groupId>org.apache.hadoop</groupId>
88+
<artifactId>hadoop-client-api</artifactId>
89+
</exclusion>
90+
</dependency>
91+
```
92+
93+
- **sbt**
94+
```scala
95+
libraryDependencies += "org.apache.kyuubi" % "kyuubi-hive-jdbc-shaded" % "1.5.0-incubating" exclude("org.apache.hadoop", "hadoop-client-api")
96+
```
97+
98+
- **gradle**
99+
```gradle
100+
implementation (group: 'org.apache.kyuubi', name: 'kyuubi-hive-jdbc-shaded', version: '1.5.0-incubating') { exclude group: 'org.apache.hadoop', module: 'hadoop-client-api' }
101+
```

0 commit comments

Comments
 (0)