Skip to content

SQL Workbench ​

Data Engineering → Workbench → Query Editor is the SQL IDE. It has two engines:

TabEngineRuns asGovernance
LakehouseTrinoYou✅ Your row filters, column masks and access policies all apply
DN WarehouseStarRocksA shared workspace roleWorkspace 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) ​

CatalogContents
lakehouse (also iceberg)All Iceberg tables: bronze, silver, gold, sandboxes
dnwYour DN Warehouse database
postgresWorkspace operational Postgres. Internal; read-only use.
system, tpch, tpcdsBuilt-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 / JOIN are 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.

RuleValue
EnginesLakehouse (Trino) only. Disabled on DN Warehouse ("Run a Lakehouse query first").
StatementsSELECT / WITH only
GovernanceSame row filters and masks as the grid
Size / time1 GiB / 20 min per export
Rate5 per minute, 50 per hour
Your LIMITRespected
Failure mid-streamError, no file. An engine or network failure never leaves a partial file behind.
⚠️ Hitting the 1 GiB capThe 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.

SettingValue
DriverTrino
Hostquery.<domain> (your admin will confirm the exact host)
Port443, SSL on
JDBC URLjdbc:trino://query.<domain>:443/lakehouse?SSL=true
User / passwordYour platform credentials
Cataloglakehouse
  • 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 sizes

If $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 ​

SymptomCauseDo
Only 10,000 rowsInteractive capExport CSV
Export CSV disabledOn DN Warehouse tab, or no Lakehouse query yetSwitch to Lakehouse and run first
Export rate limit reached5/min, 50/hWait
Export 403 with explanationYour identity couldn't be established for the exportContact your admin
Access Denied: Cannot select from …No policy grants you that tableAsk a workspace admin (Access & Policies)
Schema browser shows only default or nothingAn over-broad policy is hiding schemas from youContact your admin
DN Warehouse shows no databasesWarehouse not connected, or grants incompleteConnect to Warehouse; if it persists, contact your admin
Access Denied on mv_* tablesCube MVs are only readable through the semantic layerUse the cube (Semantic Layer (Cubes))
TABLE_NOT_FOUND on a CTE nameOlder release auto-qualified CTE namesFully qualify real tables; ask for an upgrade
Exceeded per-node memory limitJoin or aggregation too bigFilter earlier, reorder the join, pre-aggregate in dbt

Built with VitePress · DataNature, a product by Dlytica Inc.