Skip to content

Querying the data warehouse on StarRocks

The Starburst Galaxy web UI and laptop dbt-trino builds stop working when Galaxy access is revoked on 2027-01-29, the day before the contract ends. The warehouse tables are the same Iceberg tables on StarRocks, under the ol_data_lake_production catalog, e.g. ol_data_lake_production.ol_warehouse_production_mart.marts__combined__users. Which way in depends on what you are doing.

Superset SQL Lab

SQL Lab has a "StarRocks - Lakehouse" database next to the Trino one. You log in with Touchstone as usual.

  • ol_data_engineer can query every table.
  • Other roles with SQL Lab, mainly ol_researcher, can query only the tables they have a Superset dataset for.

Queries run as Superset's shared read-only account, not as you.

Notebooks

The Data Platform Notebooks JupyterHub connects marimo notebooks to StarRocks as you, with your own roles. Use it for exploration, pandas or Polars work, and anything you want to save and rerun.

Command line and Python on your laptop

bin/starrocks-auth in ol-data-platform logs you in through Keycloak in the browser and caches the token. Run it with uv run from a checkout of that repo, so it finds its dependencies. --port-forward tunnels the FE's MySQL port to localhost:9030 with kubectl, so your active kubeconfig needs the data-production (or data-qa) context.

For an interactive SQL shell:

uv run bin/starrocks-auth --env production --port-forward --output mysql

This needs Oracle's MySQL client 9.2 or later, for its authentication_openid_connect_client plugin. The MariaDB mysql that most Linux distributions install doesn't have it.

From Python, run your script under starrocks-auth, which keeps the tunnel open and the token file fresh while it runs:

uv run bin/starrocks-auth --env production --port-forward --output exec -- \
    uv run --with 'mysql-connector-python>=9.1' python my_query.py

and connect with mysql-connector-python and the token file it names:

import os

import mysql.connector

conn = mysql.connector.connect(
    host="127.0.0.1",
    port=9030,
    user=os.environ["STARROCKS_USER"],
    auth_plugin="authentication_openid_connect_client",
    openid_token_file=os.environ["STARROCKS_ID_TOKEN_FILE"],
)

StarRocks checks the token only when you connect, so open a new connection rather than holding one for hours.

Use --env qa for the QA lake (ol_data_lake_qa).

dbt development builds

Laptop builds of your own copy of the warehouse use ol-dbt starrocks under starrocks-auth, as yourself, with your login in the schema names. Trino to StarRocks migration for dbt authors has the commands. The short form:

uv run bin/starrocks-auth --env qa --output exec -- \
    ol-dbt starrocks build --env qa --target starrocks_dev_qa --select +my_model

SQL differences from Trino

Most queries run unchanged. Two differences catch people:

  • length() counts bytes on StarRocks and characters on Trino. Use char_length().
  • Double quotes make a string literal, not an identifier. Quote identifiers with backticks, e.g. `time`.

The dialect compatibility notes list the function differences the dbt project handles.