Stackable
This guide covers how to connect Spark on Kubernetes with a Hive Metastore to Zeotap. That is the stack the Stackable Data Platform runs, whether you operate Stackable yourself or buy the managed Stackable Data Lakehouse from a hosting partner. The same guide applies to any other Spark-on-Kubernetes cluster whose tables live in a Hive Metastore.
A Stackable warehouse is a Spark Lakehouse source with a preset: Zeotap submits Spark SQL to Stackable’s own Spark Connect server (or, if you prefer, a Kyuubi gateway) in your cluster, the Spark engines read your tables through the Hive Metastore, and Zeotap keeps its own working tables as Iceberg tables in a storage location you choose. Everything on the Spark Lakehouse page that is not about the catalog or sign-in applies here too.
Two deployments
When you add a Stackable warehouse you first choose who runs the cluster. The choice decides which sign-in methods are offered, and it is fixed once the warehouse is saved: to switch, create a new warehouse.
| Self-run | Managed | |
|---|---|---|
| Who runs the cluster | You, with Stackable’s operators or any Spark-on-Kubernetes setup | A hosting partner offering the Stackable Data Lakehouse |
| SQL endpoint | A Spark Connect server (the default) behind a proxy, or Kyuubi | Spark Connect or Kyuubi, exposed by the partner |
| Sign-in methods | Basic (Kyuubi LDAP) or Bearer token | OIDC client credentials or Bearer token |
| Access control | Whatever you use: OPA, Ranger or the metastore’s own authorization | OPA, administered by the partner |
Sign-in methods
| Method | What Zeotap sends | Use it when |
|---|---|---|
| Basic | A username and password as Authorization: Basic | Kyuubi checks them against LDAP (kyuubi.authentication=LDAP), or the proxy in front of Spark Connect checks them |
| Bearer token | A static token as Authorization: Bearer | The proxy or ingress (or a custom Kyuubi authentication provider) checks a token you issue |
| OIDC client credentials | A token fetched from your identity provider’s token endpoint with a client ID and secret | The proxy or ingress validates tokens from an OIDC issuer (Keycloak or any other) |
Over Spark Connect the same header travels as gRPC metadata. Spark Connect checks nothing itself, so the proxy in front of it must.
With OIDC client credentials, Zeotap requests a token from the token URL you give it, keeps using it until shortly before it expires, and requests a new one if the endpoint refuses it. If the token endpoint uses a certificate from a private CA, the CA certificate you add for the endpoint is trusted for the token endpoint too.
A Stackable warehouse never connects without signing in, because it is reached across networks.
Support matrix
The connection test reads the Spark version and catalog setup and tells you when a cluster is outside this matrix.
| Component | Supported | Not supported |
|---|---|---|
| Spark | 4.1.x (Stackable’s LTS) with Iceberg 1.11 or later. 4.0.x with Iceberg 1.10 or later. 3.5.x with Iceberg 1.10 or later through Kyuubi only. A newer Spark is accepted with a warning | Spark 3.5 through Spark Connect: Iceberg fails on the executors before Spark 4. Any engine without Iceberg in the session catalog |
| Hive Metastore | Stackable 26.11’s 4.2.0 and 4.2.1 images, which carry Stackable’s patch restoring get_table. 3.1.3 and 4.0.0 | Stackable 26.7’s 4.2.0 image, and any 4.0.1, 4.1 or 4.2 without that patch: Spark cannot write Zeotap’s tables (Invalid method name: 'get_table'). On Stackable 26.7, run the metastore on 3.1.3 or 4.0.0, or move to 26.11 |
| Table format for Zeotap’s tables | Iceberg (USING iceberg) | Delta, Hudi |
| Your own tables | Iceberg or plain Hive tables. Zeotap only reads them | — |
| Storage | Any location Spark can write: S3, ADLS, GCS or HDFS. Zeotap never touches storage directly; the engines do | — |
| Gateway | Spark Connect (the default) or Kyuubi REST | Livy |
What you must provide
- A reachable SQL endpoint. A proxy that terminates TLS and checks sign-in in front of a Spark Connect server, or Kyuubi’s REST frontend behind TLS, with Zeotap’s egress IPs (
34.76.7.172and34.22.225.249) allowed through. - A service identity for one of the sign-in methods above.
- Access rules (OPA or otherwise) that let that identity read your schemas, and create and write Zeotap’s own schemas:
cdp_planner,cdp_audit,cdp_journey,cdp_identity,cdp_rawandaudit_logs. - A storage location for Zeotap’s schemas, such as
s3a://lake/zeotap. Each schema is created at<location>/<schema>.db, so Zeotap’s data stays out of your metastore’s default warehouse directory. - Engine limits you are happy to pay for: the executor ceiling and the engine idle timeout. Zeotap’s footprint is bounded by them.
Reference engine setup
On the managed offering the partner runs this part. If you run the cluster yourself, this is the setup Zeotap is tested against.
Hive Metastore
Run Stackable 26.11’s Hive Metastore 4.2.1 (or 4.2.0), which carries the restored get_table. Stackable 26.7’s 4.2.0 image does not: on 26.7, run the metastore on 3.1.3 or 4.0.0 (see the support matrix). Zeotap is tested against Stackable’s own images: Hive Metastore 4.2.1-stackable26.11 and Spark 4.1.2-stackable26.7, through both gateways.
Spark engine
Use a Spark image with the Iceberg Spark runtime for its version on the classpath:
| Spark | Iceberg runtime |
|---|---|
| 4.1.x (Stackable’s LTS) | org.apache.iceberg:iceberg-spark-runtime-4.1_2.13, 1.11 or later |
| 4.0.x | org.apache.iceberg:iceberg-spark-runtime-4.0_2.13, 1.10 or later |
| 3.5.x | org.apache.iceberg:iceberg-spark-runtime-3.5_2.12, 1.10 or later |
Derive the image from Stackable’s Spark image or the Apache Spark image. Stackable’s Spark images do not include Iceberg; add it to a derived image or with spark.jars.packages. Spark 4 runs SQL in ANSI mode by default; leave it on, Zeotap’s queries are written for it.
Configure the session catalog as Iceberg’s SparkSessionCatalog over the Hive Metastore, so your plain Hive tables and Zeotap’s Iceberg tables live side by side in spark_catalog:
spark.sql.extensions=org.apache.iceberg.spark.extensions.IcebergSparkSessionExtensions
spark.sql.catalog.spark_catalog=org.apache.iceberg.spark.SparkSessionCatalog
spark.sql.catalog.spark_catalog.type=hive
spark.sql.catalog.spark_catalog.uri=thrift://<hive-metastore>:9083
spark.sql.catalogImplementation=hiveAdd the settings for your object store as well (S3A or Iceberg’s S3FileIO, for example).
Spark Connect server
The default gateway is a SparkConnectServer, run by Stackable’s Spark operator. Give Zeotap a server of its own:
- Every session shares the server’s one driver. A large Zeotap job and your own users would otherwise compete for the same memory, and a driver failure ends every session on it.
- Queries run with the server’s identity, not a per-user one, so the metastore, OPA and storage permissions are the server’s. A dedicated server can hold exactly the permissions Zeotap needs.
It must run Spark 4: through Spark Connect, Iceberg fails on the executors with Spark 3.5. A reference manifest to adapt:
apiVersion: spark.stackable.tech/v1alpha1
kind: SparkConnectServer
metadata:
name: zeotap
spec:
image:
productVersion: "4.1.2"
args:
- "--packages org.apache.iceberg:iceberg-spark-runtime-4.1_2.13:1.11.0"
server:
configOverrides:
spark-defaults.conf:
spark.sql.extensions: "org.apache.iceberg.spark.extensions.IcebergSparkSessionExtensions"
spark.sql.catalogImplementation: "hive"
spark.sql.catalog.spark_catalog: "org.apache.iceberg.spark.SparkSessionCatalog"
spark.sql.catalog.spark_catalog.type: "hive"
spark.sql.catalog.spark_catalog.uri: "thrift://<hive-metastore>:9083"
executor:
configOverrides:
spark-defaults.conf:
spark.executor.instances: "3"Clients reach the server at the zeotap-server service on port 15002 (gRPC). Set executor sizing on the server, as above: Zeotap sets only runtime SQL settings per session (its resource pool and default catalog), and Spark Connect refuses the rest.
A proxy in front of Spark Connect
Spark Connect has no sign-in of its own: anyone who can reach the server can run jobs on it. Never expose it directly. Put a proxy in front of zeotap-server:15002 that:
- terminates TLS with a certificate from your CA (paste a private CA into TLS CA certificate);
- speaks HTTP/2 to the client and gRPC to the server;
- checks the
authorizationheader Zeotap sends (Basic, a Bearer token you issue, or a token from your OIDC issuer); - keeps idle and read timeouts above the warehouse’s statement timeout, because results arrive as one long stream.
Envoy (with its JWT authentication filter), or an NGINX ingress with a gRPC backend and an external authentication service, both work. The proxy’s https URL is the Spark Connect endpoint you enter in Zeotap.
Kyuubi
Kyuubi is the alternative gateway: use it for Spark 3.5, or if you already run Kyuubi.
Install Kyuubi 1.12 from the Helm chart in the Kyuubi repository (it is not published to a chart repository). The values below are a reference to adapt, not a drop-in file: check the keys against the chart version you install.
# values-zeotap.yaml (reference)
server:
rest:
enabled: true
port: 10099
thriftBinary:
enabled: false
kyuubiConf:
kyuubiDefaults: |
kyuubi.frontend.protocols=REST
# One engine per user, kept warm between statements
kyuubi.engine.share.level=USER
kyuubi.session.engine.idle.timeout=PT30M
kyuubi.session.engine.initialize.timeout=PT5M
# Sign-in: LDAP behind HTTP Basic
kyuubi.authentication=LDAP
kyuubi.authentication.ldap.url=ldaps://ldap.example.internal:636
kyuubi.authentication.ldap.baseDN=ou=people,dc=example,dc=internal
sparkConf:
sparkDefaults: |
spark.master=k8s://https://kubernetes.default.svc
spark.submit.deployMode=cluster
spark.kubernetes.namespace=lakehouse
spark.kubernetes.authenticate.driver.serviceAccountName=spark-driver
spark.kubernetes.container.image=<your Spark + Iceberg image, see the Spark engine section>
spark.kubernetes.file.upload.path=s3a://lake/kyuubi-uploads
spark.dynamicAllocation.enabled=true
spark.dynamicAllocation.shuffleTracking.enabled=true
spark.dynamicAllocation.maxExecutors=10
# plus the catalog settings from the Spark engine section above- Share level
USER(orGROUP) keeps one engine running for Zeotap’s identity, so statements do not each wait for a new engine. - Idle timeout of at least
PT30Mkeeps that engine alive between the statements of a sync or journey run. - Initialization timeout of at least
PT5Mgives an engine time to start on Kubernetes, including pulling its image. - No
kyuubi.operation.query.timeout, or one longer than the warehouse’s statement timeout (30 minutes unless you change it on the warehouse). A shorter Kyuubi timeout cancels long sync and journey statements before Zeotap’s own limit, and a cancelled write is never retried. - Cluster mode with a driver service account lets Kyuubi start engine drivers as pods. The service account needs permission to create and delete executor pods in the engine namespace.
TLS at an ingress (Kyuubi)
Kyuubi’s REST frontend does not serve TLS itself, so put an ingress (or a TLS-terminating sidecar) in front of it with a certificate from your CA. If that CA is not publicly trusted, paste its certificate into the warehouse’s TLS CA certificate field.
For OIDC client credentials, the ingress is also where tokens are validated: Kyuubi has no OIDC support of its own. Any ingress or proxy that validates bearer tokens against your issuer works.
# Example: an ingress ending TLS in front of Kyuubi REST
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: kyuubi-rest
spec:
tls:
- hosts: [kyuubi.example.com]
secretName: kyuubi-rest-tls
rules:
- host: kyuubi.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: kyuubi-rest
port:
number: 10099Access control
Zeotap needs to read your schemas, and to create, alter and drop databases and tables in its own schemas, plus read and write their storage location. How you grant that depends on your authorizer.
Example only. The OPA policy below shows the idea: allow Zeotap’s identity full control of databases whose names start with cdp_ or equal audit_logs, and read access elsewhere. The input document and rule names depend on the authorizer your metastore and Spark use, so write the real policy against your own setup.
package lakehouse.zeotap
import rego.v1
zeotap := "svc-zeotap"
zeotap_schema(db) if startswith(db, "cdp_")
zeotap_schema(db) if db == "audit_logs"
default allow := false
# Full control of Zeotap's own schemas
allow if {
input.identity.user == zeotap
zeotap_schema(input.resource.database)
}
# Read access to the schemas Zeotap models read from
allow if {
input.identity.user == zeotap
input.action in {"SELECT", "DESCRIBE", "SHOW"}
}Setting up the warehouse in Zeotap
-
Go to Warehouses and click Add Warehouse.
-
Choose Stackable, then choose the deployment: Self-run or Managed.
-
Enter the connection:
Field Description Example Gateway Spark Connect (default) or Kyuubi Spark Connect Spark Connect endpoint (or Kyuubi REST endpoint) The httpsURL of the proxy in front of the Spark Connect server, or of the ingress in front of Kyuubi, including the porthttps://spark-connect.example.com:443Default schema The schema you browse and build models from cdpWarehouse path The storage location for Zeotap’s schemas. Required s3a://lake/zeotapThe catalog is fixed to
spark_catalogand the catalog type to Hive Metastore. -
Choose the sign-in method and enter its credentials:
Method Fields Basic Username and password Bearer token Token OIDC client credentials Token URL (your issuer’s token endpoint), scope (optional), client ID and client secret Secrets are stored encrypted and never returned by the API.
-
If the proxy’s or ingress’s certificate comes from a private CA, paste the CA certificate (PEM) into TLS CA certificate.
-
Optionally set the statement timeout (default 30 minutes). A statement still running at the limit is cancelled on the engine and reported as failed; it is not run again.
-
Click Test connection, then save.
The same warehouse can be created through the API. A managed example:
{
"name": "Stackable lakehouse",
"source_type": "spark_lakehouse",
"config": {
"platform": "stackable",
"deployment": "managed",
"endpoint": "https://spark-connect.example.com",
"transport": "spark_connect",
"catalog_type": "hive",
"catalog": "spark_catalog",
"schema": "cdp",
"zeotap_warehouse_path": "s3a://lake/zeotap",
"auth_method": "oidc_client_credentials",
"token_url": "https://id.example.com/realms/lakehouse/protocol/openid-connect/token",
"scope": "openid",
"tls_ca_cert": "-----BEGIN CERTIFICATE-----\n…\n-----END CERTIFICATE-----",
"statement_timeout_seconds": 1800
},
"credentials": {
"client_id": "zeotap",
"client_secret": "…"
}
}For Kyuubi use "transport": "kyuubi" with the Kyuubi endpoint. For a self-run warehouse use "deployment": "self_run" with "auth_method": "basic" and username / password credentials, or "auth_method": "bearer" with a token.
Connection test
The test runs these steps in order. Each failing step comes with a suggested fix in terms of the metastore, OPA or Ranger, and storage.
| Step | What it checks | What a failure usually means |
|---|---|---|
validate_config | The fields above fit a Stackable warehouse | A required field is missing, or the sign-in method does not fit the deployment |
authenticate | Runs SELECT 1 through the proxy and Spark Connect, or the ingress and Kyuubi | The endpoint is unreachable from Zeotap’s egress IPs, the certificate is not trusted (add the CA), the proxy does not speak HTTP/2 to Spark Connect, or the sign-in was refused |
support_matrix | Reads SELECT version() and checks that spark_catalog is Iceberg’s SparkSessionCatalog | The catalog settings are missing, or a Spark Connect server runs Spark 3.5. A Spark version outside the support matrix passes with a warning |
list_catalog | Lists the schemas in spark_catalog | Zeotap’s identity may not list databases in the metastore |
read_tables | Lists the tables in the default schema and describes one | Invalid method name: 'get_table': the metastore is 4.0.1 (or 4.1/4.2) without the restoring patch. Otherwise, the identity may not read the schema’s tables or their storage |
write_probe | Creates Zeotap’s namespace and writes an Iceberg table there | The identity may not create databases, or the engines may not write the warehouse path |
write_planner, write_audit, write_journey, write_identity, write_raw, write_audit_logs | Creates each of Zeotap’s schemas at the warehouse path and writes a test table | The same, for that schema |
If the engine has no Iceberg classes at all, the failing step says so and names the runtime to add.
Data residency
Zeotap’s tables and all of its computation stay in your lakehouse: the queries run on your Spark engines and write to the storage location you chose. Query results that Zeotap acts on (previews, sync payloads, identity and journey results) pass through Zeotap’s workers, and inbound events are staged in Zeotap’s cloud storage before they are written into your lakehouse.
Performance
- Commits on Hive Metastore 3.1.3 take about 6 seconds each. That metastore has no lock-free commits, so every Iceberg write and every schema change waits on metastore locks. A sync issues dozens of commits, so expect syncs and journeys to take noticeably longer than on other warehouses.
- A Spark Connect server is always running, so statements never wait for an engine, but it holds its driver (and any executors you pin) while Zeotap is idle.
- With Kyuubi, the first statement after an idle period waits for an engine to start. With share level
USERand an idle timeout of 30 minutes or more, that happens once per busy period rather than per statement. - Concurrent writes to one table can conflict. When two writers race on the same Iceberg table, Zeotap retries the losing statement automatically, up to five times with increasing waits. A write whose outcome is unknown is never retried.
- Queries are validated without running them. Model and trait SQL is checked with
EXPLAIN, so validating a query does not start a job.
Limits
- Your plain Hive tables are read-only for Zeotap. Spark cannot update, delete from or merge into them. Zeotap only reads your tables, so this does not affect models, audiences or syncs; its own tables are always Iceberg.
- Kerberos is not supported. Put a proxy or ingress in front of the gateway that accepts one of the sign-in methods above.
- Spark Connect needs Spark 4 and a proxy. Stackable marks its Spark Connect support experimental; Kyuubi remains available if you need Spark 3.5 or prefer per-user engines.
- Livy is not offered for Stackable warehouses.
- The deployment is fixed. A warehouse created as self-run or managed stays that way; create a new warehouse to change it.
- Everything listed under Spark-specific notes on the Spark Lakehouse page also applies.
Next Steps
- Create a model on your Stackable warehouse
- Understand connection testing
- Set up a Reverse ETL sync to activate your data