Skip to content

Commit de0ea37

Browse files
wayne-x-wangpan3793
authored andcommitted
[KYUUBI #6497][DOC] Document Apache Superset integration
### Why are the changes needed? The Apache Superset page currently contains only an incomplete-document warning. This patch documents the required database driver, the SQLAlchemy connection URI, and query verification in SQL Lab. It also includes a reproducible driver installation workaround for containers without a C++ compiler. Closes #6497. ### How was this patch tested? Manually verified on macOS ARM64 with: - Apache Superset 6.1.0 - Apache Kyuubi 1.11.0 - Apache Spark 3.5.7 - PyHive 0.7.0 Verification: - Installed the documented driver dependencies in the Superset containers. - Successfully tested and saved the Apache Hive connection to Kyuubi. - Executed `SELECT 1 AS test_value` in SQL Lab and received one row with value `1`. - Queried `tpcds.tiny.customer` with `LIMIT 5` and received five rows with the three selected columns. Local checks: - `dev/reformat`: BUILD SUCCESS. - `git diff --check`: passed. - Sphinx HTML build: succeeded with five substitution warnings in the unchanged `docs/configuration/settings.md`. - Verified the generated page's section anchors and internal documentation links. No automated unit tests were added because this change only updates documentation. ### Was this patch assisted by generative AI tooling? Assisted-by: OpenAI Codex with GPT-6 Astra Closes #7783 from wayne-x-wang/kyuubi-6497-superset-doc. Closes #6497 0dac274 [Wayne Wang] [KYUUBI #6497][DOC] Document Apache Superset integration Authored-by: Wayne Wang <weiywang.cn@gmail.com> Signed-off-by: Cheng Pan <chengpan@apache.org>
1 parent 771be6a commit de0ea37

1 file changed

Lines changed: 92 additions & 3 deletions

File tree

‎docs/client/bi_tools/superset.md‎

Lines changed: 92 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,97 @@
1717

1818
# Apache Superset
1919

20-
```{warning}
21-
The document you are visiting now is incomplete, please help kyuubi community to fix it if appropriate for you.
20+
[Apache Superset](https://superset.apache.org/) is an open source platform for
21+
data exploration and visualization. It can connect to Kyuubi through the
22+
HiveServer2 protocol using the PyHive SQLAlchemy dialect.
23+
24+
## Prerequisites
25+
26+
- A running Kyuubi server with a Thrift binary frontend accessible from Superset.
27+
See [Getting Started](../../quick_start/quick_start.md).
28+
- A running Superset instance with the PyHive driver installed.
29+
30+
The following setup was tested with:
31+
32+
| Component | Version |
33+
|-----------------|---------|
34+
| Apache Superset | 6.1.0 |
35+
| Apache Kyuubi | 1.11.0 |
36+
| Apache Spark | 3.5.7 |
37+
| PyHive | 0.7.0 |
38+
39+
## Install the database driver
40+
41+
Install the driver in the Python environment used by Superset.
42+
43+
For a deployment using Superset's Docker Compose configuration, add the following
44+
dependencies to `docker/requirements-local.txt` in the Superset checkout before
45+
starting the services:
46+
47+
```text
48+
PyHive[hive_pure_sasl]==0.7.0
49+
thrift>=0.14.1,<1.0.0
50+
thrift_sasl>=0.4.3,<1.0.0
51+
tableschema
52+
```
53+
54+
The `hive_pure_sasl` extra uses a pure Python SASL implementation. With
55+
Superset 6.1.0 on Python 3.10, installing `apache-superset[hive]` also pulls in
56+
the native `sasl` package. Its installation can fail when the container does
57+
not have a C++ compiler.
58+
59+
Make sure the driver is installed in each Superset container that executes queries.
60+
61+
## Configure the connection
62+
63+
1. Open **Settings → Database Connections** and click **+ Database**.
64+
2. Select **Apache Hive**.
65+
3. Choose the **SQLAlchemy URI** connection method.
66+
4. Enter a display name and a connection URI:
67+
68+
```text
69+
hive://<username>@<kyuubi-host>:10009/<database>?auth=NONE
70+
```
71+
5. Click **Test connection**, then save the connection.
72+
6. Enable **Expose database in SQL Lab** in the database's advanced settings.
73+
74+
Replace the host, port, username, and database with values for your environment.
75+
The default Kyuubi Thrift binary port is `10009`.
76+
77+
The example uses `NONE` authentication for local testing. For other
78+
authentication mechanisms, see [PyHive authentication](../python/pyhive.md#authentication).
79+
80+
When Superset runs in a container on macOS and Kyuubi's port is published on
81+
the host, the following URI can be used:
82+
83+
```text
84+
hive://anonymous@host.docker.internal:10009/default?auth=NONE
85+
```
86+
87+
The hostname must be reachable from the Superset container. In this example,
88+
`host.docker.internal` refers to the host machine.
89+
90+
## Run queries in SQL Lab
91+
92+
1. Open **SQL → SQL Lab**.
93+
2. Click **Add a new tab**.
94+
3. Select the saved Kyuubi connection and a schema.
95+
4. Execute the following query:
96+
97+
```sql
98+
SELECT 1 AS test_value;
99+
```
100+
101+
The result should contain one row with `test_value` equal to `1`.
102+
103+
When using the Kyuubi Docker playground, select the `tiny` schema and query
104+
the sample TPC-DS customer table:
105+
106+
```sql
107+
SELECT c_customer_sk, c_first_name, c_last_name
108+
FROM tpcds.tiny.customer
109+
LIMIT 5;
22110
```
23111

24-
See [Apache Superset](https://superset.apache.org/)
112+
This query returns up to five rows with the three selected columns.
113+
The `tpcds.tiny.customer` table is provided by the playground's TPC-DS catalog.

0 commit comments

Comments
 (0)