Skip to content
MCP server built inHow that works

SQL queries

Under Daten → Abfragen (data → queries) sits a SQL worksheet over Trino. Every statement runs under your identity — what you see here is exactly what Trino shows you.

On this page

Reads run, writes ask first

Every statement is classified before it runs, fail-closed. Reads go straight through, writes after a confirmation.

Finding objects

Addressing is three-part: catalog, schema, table. A fresh installation's catalog is called iceberg; alongside it sit Trino's own catalogs system, jmx and memory, plus the sample data in tpch and tpcds.

What is there?
SHOW CATALOGS;
SHOW SCHEMAS FROM iceberg;
SHOW TABLES FROM iceberg.produkte;
DESCRIBE iceberg.produkte.produkte;

Querying

From here on it is ordinary SQL. The example below works on the table from the data browser — article number, description, category, net price, VAT rate and stock.

Gross price per category
SELECT
    kategorie,
    count(*)                                        AS artikel,
    round(avg(preis_netto_eur * (1 + mwst_prozent / 100.0)), 2) AS brutto_schnitt,
    sum(lagerbestand)                               AS bestand
FROM iceberg.produkte.produkte
WHERE lagerbestand > 0
GROUP BY kategorie
ORDER BY brutto_schnitt DESC;

The same limits everywhere

A row hidden by policy is missing here just as in search or a BI extract — Trino appends the condition, not the interface.

Travelling back in time

Iceberg does not rewrite rows; it writes new snapshots, and Nessie keeps them. Any table can therefore be queried as it looked at an earlier point in time — no backup, no copy.

Listing snapshots and querying one
-- Which states exist?
SELECT snapshot_id, committed_at, operation
FROM iceberg.produkte."produkte$snapshots"
ORDER BY committed_at DESC;

-- Yesterday morning
SELECT count(*) AS zeilen
FROM iceberg.produkte.produkte
FOR TIMESTAMP AS OF TIMESTAMP '2026-09-03 08:00:00 Europe/Berlin';

-- Or one particular snapshot
SELECT *
FROM iceberg.produkte.produkte
FOR VERSION AS OF 8623201004411246578
LIMIT 20;

Besides $snapshots there are further metadata tables of the same shape: $history shows the sequence of states, $files the data files behind the current one, $partitions their distribution. The quotes are required — without them Trino does not read the dollar sign as part of the name.

Creating a view

Views are the intended way to make an analysis reusable — and the only way to get one into the BI feed: the feed accepts no SQL from the caller, only the name of an object. Whatever Tableau should compute is therefore stored here as a view first.

A view for the BI extract
CREATE VIEW iceberg.produkte.v_bestandswert AS
SELECT
    artikelnummer,
    bezeichnung,
    kategorie,
    lagerbestand,
    preis_netto_eur,
    lagerbestand * preis_netto_eur AS bestandswert_netto
FROM iceberg.produkte.produkte;

CREATE VIEW is a writing statement

It needs a confirmation and the grants in Trino. The view inherits no rights of its own — whoever queries it does so under their own identity.

What has its own route

  • Metrics and semantic views: maintained under KI & Semantik → Kennzahlen and queried by name.
  • Bulk loading: that is what the five ingestion paths are for, with an assistant instead of hand-written INSERTs.
  • The catalog itself: the installation brings it along; it is not created in SQL.

Applies to: This page describes lavalake 0.16.0. Product and documentation live in separate repositories — when in doubt, what the console shows is authoritative.

Something missing?

If these pages do not answer your question, we will walk through the platform against your own case in half an hour.

Book a demo