Structured Data Audit (Trino)
The Structured Data Audit view answers one forensic question about your Trino query engine: who ran what SQL against which catalog, schema, and table, and what did the query read, write, or delete? It is the structured-data (SQL and RDBMS) counterpart of the file and object audit in File Activity. Like File Activity, it is read-only and never modifies data.
Where: Data Auditing > Structured Data Audit (Trino)
Overview
The Superna Trino event-listener plugin records every completed Trino query and sends it to the console. The console stores one row for each table that a query accessed. Each row captures:
- The user.
- The catalog, schema, and table.
- The operation (read, write, or delete).
- The query type (SELECT, INSERT, UPDATE, DELETE, MERGE, CREATE, DROP, ALTER, and so on).
- The bytes and rows touched, and the wall and CPU time.
- The query state (FINISHED or FAILED).
- The client IP address and the cluster.
- The full SQL text.
Results include only events that are fully ingested. Filters are combined with AND, so each additional filter narrows the results.
Views
The page offers two views of the same data.
Table changes by user
This is the landing view. It groups activity by user, table, and operation over the selected time window. Each row shows:
- The query count.
- Rows changed — the sum of written and updated rows.
- Bytes.
- The number of distinct queries.
- The client IP addresses that the queries came from, separated by commas. A dash (
—) means that none were recorded. - When the activity was last seen.
The view shows which users changed which tables, from where, and by how much. Click a row to open the Query browser, filtered to that user, table, and operation.
Query browser
This is the forensic drill-down, with one row for each table access. The columns are:
- Event Time
- Trino User
- Operation (badge)
- Query Type
- Catalog / Schema / Table (breadcrumb)
- Rows
- Bytes
- Wall ms
- State
- Client IP
- Cluster
The full SQL is not shown in the grid. Open the row flyout to see it. The flyout also shows the query ID, the CPU and wall time, the error type and code, and the raw authentication principal.
The SQL is stored up to 100,000 characters; longer statements are truncated. It is shown without redaction to operators who have audit access.
Operations and DML/DDL
Two classifications describe each query, and both come from the recorded query.
- Operation — read (SELECT), write (INSERT, UPDATE, MERGE), or delete (DELETE). The Table changes by user view groups by this value.
- DML or DDL — derived from the query type. DDL is schema and permission changes (CREATE, DROP, ALTER, TRUNCATE, RENAME, COMMENT, GRANT, and REVOKE). DML is everything else, including SELECT, INSERT, UPDATE, DELETE, and MERGE. The Category dropdown isolates DDL (schema) or DML (data).
The user shown
The Table changes by user view and the Trino User filter use one canonical user. It is the Trino user when one is present, and the authentication principal otherwise. Unauthenticated Trino clients record their identity in the principal field instead of the user field, so combining both gives one consistent "who".
The Query browser shows the raw Trino user, which can be empty for those clients. The row flyout shows the raw principal separately.
Filters
Leave a filter unset to match everything.
| Filter | Description |
|---|---|
| Time range | From and to timestamps. Events outside the window are excluded. |
| Trino User | Matches the canonical user (Trino user or principal). |
| Catalog | The Trino catalog, for example hive or iceberg. |
| Schema | The schema within the catalog. |
| Table contains | Substring match on the table name. |
| Query Type | SELECT, INSERT, UPDATE, DELETE, MERGE, CREATE, DROP, ALTER, and so on. |
| Operation | read, write, or delete. |
| Category | DML (data) or DDL (schema). |
| Cluster | The Trino cluster that ran the query. |
| Query State | FINISHED or FAILED. Failed queries are kept for forensics. |
| Query text contains | Substring search over the stored SQL. |
Workflows
Find who changed a sensitive table
- Switch the Data Auditing view to Structured Data Audit (Trino). The Table changes by user view opens.
- Set the time window and enter the table name in Table contains.
- Read each user, operation, and rows-changed value.
- Click a row to open the individual queries, and read the full SQL in the flyout.
Find every schema change in a time window
- In the Structured Data Audit (Trino) view, open the Query browser.
- Set the time window and set Category to DDL (schema).
- Each row shows who ran the schema or permission change and against which table. Open the flyout for the full statement.
Tips
- Trino audit rows are kept for 12 months. Older rows expire automatically and no longer appear.
- A query that touches several tables produces several rows, one for each accessed table. Counts in the summary strip show table accesses, not distinct queries. Use the distinct queries column in the rollup for the query count.
- The updated-rows value is always 0, because Trino does not report a count of updated rows. Rows affected by MERGE and UPDATE queries are counted in the written rows.
- If the view is empty, confirm that the Trino plugin is installed and that the coordinator was restarted. See Trino Audit settings. Audit rows flow only after the listener loads.