Appearance
SQL Workbench
Data Engineering → Workbench → Query Editor is the SQL IDE. It has two engines:
| Tab | Engine | Runs as | Governance |
|---|---|---|---|
| Lakehouse | Trino | You | ✅ Your row filters, column masks and access policies all apply |
| DN Warehouse | StarRocks | A shared workspace role | Workspace isolation only. Not per-user. |
For sensitive data, use the Lakehouse tab. It is the fully per-user governed SQL surface.
Catalogs you'll see (Lakehouse tab)
| Catalog | Contents |
|---|---|
lakehouse (also iceberg) | All Iceberg tables: bronze, silver, gold, sandboxes |
dnw | Your DN Warehouse database |
postgres | Workspace operational Postgres. Internal; read-only use. |
system, tpch, tpcds | Built-in and benchmark data |
In the DN Warehouse, your database is <safe> (the workspace slug with underscores). Lakehouse tables are also visible there through the external catalog <safe>_iceberg, e.g. SELECT … FROM <safe>_iceberg.gold.sales_daily.
Running queries
- Ctrl/⌘ + Enter runs the query.
- Pick a catalog and schema, and bare table names in
FROM/JOINare qualified for you. Fully qualifying (lakehouse.gold.sales) always works. - Limit dropdown: 50 / 100 / 1,000 / 10,000. Interactive results are capped at 10,000 rows. The grid pages 500 rows at a time.
- Copy copies the returned result as CSV. The Voir side panel can Explain this query or Optimize for performance.
- On the DN Warehouse tab you may first need Connect to Warehouse.
Export CSV (full, governed exports)
Export CSV re-runs your last Lakehouse query on the server as you and streams every row to a file. It is not limited to the 10k rows in the grid.
| Rule | Value |
|---|---|
| Engines | Lakehouse (Trino) only. Disabled on DN Warehouse ("Run a Lakehouse query first"). |
| Statements | SELECT / WITH only |
| Governance | Same row filters and masks as the grid |
| Size / time | 1 GiB / 20 min per export |
| Rate | 5 per minute, 50 per hour |
Your LIMIT | Respected |
| Failure mid-stream | Error, no file. An engine or network failure never leaves a partial file behind. |
| ⚠️ Hitting the 1 GiB cap | The file stops at 1 GiB with no warning. It looks complete but isn't. If an export is close to 1 GiB, assume it was cut off: add filters, split by date range, or write a table instead. |
For bigger extracts, write a table (dbt or notebook) and ask about bulk-export options.
Connecting DBeaver, JDBC and BI tools
External SQL clients connect to the query engine with your platform username and password. Queries run as you, so governance applies.
| Setting | Value |
|---|---|
| Driver | Trino |
| Host | query.<domain> (your admin will confirm the exact host) |
| Port | 443, SSL on |
| JDBC URL | jdbc:trino://query.<domain>:443/lakehouse?SSL=true |
| User / password | Your platform credentials |
| Catalog | lakehouse |
- Complete any pending account actions in the browser first. Clients can't log in while one is pending.
- ⚠️ Update saved passwords straight after changing yours. Repeated failures lock your account.
Writing fast queries
- Filter on time. Always add a date predicate on large tables.
- Select columns, not
*. Iceberg is columnar, so fewer columns means less data scanned. - Joins: put the large table first (left) and the small or driving set second, and filter both sides before joining. Very large joins can hit the per-query memory limit (Query exceeded per-node memory limit).
- Run
ANALYZE lakehouse.<schema>.<table>on large tables you join often. Table statistics help the planner. - Prefer gold. If you repeat the same heavy query, make it a dbt gold model or a cube.
- The first query on a freshly created catalog can time out while metadata warms up. Retry.
Checking a table's partitions
sql
SELECT * FROM lakehouse.bronze_crm."orders$partitions";
SELECT * FROM lakehouse.bronze_crm."orders$files" LIMIT 20; -- file sizesIf $partitions returns 0 rows, or a single partition with a NULL key while the table has data, the table is affected by the partition case issue (Limits & Known Issues). Results are still correct, but filter on real columns, not partitions.
Troubleshooting
| Symptom | Cause | Do |
|---|---|---|
| Only 10,000 rows | Interactive cap | Export CSV |
| Export CSV disabled | On DN Warehouse tab, or no Lakehouse query yet | Switch to Lakehouse and run first |
| Export rate limit reached | 5/min, 50/h | Wait |
| Export 403 with explanation | Your identity couldn't be established for the export | Contact your admin |
Access Denied: Cannot select from … | No policy grants you that table | Ask a workspace admin (Access & Policies) |
Schema browser shows only default or nothing | An over-broad policy is hiding schemas from you | Contact your admin |
| DN Warehouse shows no databases | Warehouse not connected, or grants incomplete | Connect to Warehouse; if it persists, contact your admin |
Access Denied on mv_* tables | Cube MVs are only readable through the semantic layer | Use the cube (Semantic Layer (Cubes)) |
TABLE_NOT_FOUND on a CTE name | Older release auto-qualified CTE names | Fully qualify real tables; ask for an upgrade |
| Exceeded per-node memory limit | Join or aggregation too big | Filter earlier, reorder the join, pre-aggregate in dbt |
