Skip to main content

View query history

The query access audit lists every access check that queries made on your Lakehouse data, with the result of each check. Use it when someone reports a permission error, or to confirm that a revoked user can no longer read a table.

Prerequisites​

  • Your role includes one of these permissions.
    • query_audit:read_all shows the checks of all users.
    • query_audit:read_self shows only the checks of your own queries.
  • The portal_admin role has query_audit:read_all. No system role has query_audit:read_self. To grant it, an Admin adds it to a custom role.

Search the audit trail​

  1. In the left sidebar, select Data Security → Query access audit.
  2. In Refine audit trail, choose a time range. Select Last 1 hour, Last 6 hours, or Last 24 hours, or set From and To.
  3. Narrow the results if you need to.
    • Search audit records: part of the query text, a resource, or an access type.
    • Result: All results, Allowed, Denied, or Unknown.
  4. To filter by person or resource, select More filters, then fill in User, Resource category, Catalog, Schema, or Table.
  5. Select Show results.

The filters you change appear under Pending filters until you select Show results. Select Clear all to remove every filter.

The User list shows the people found in the audit records of the selected time range. You can also type a user name that is not in the list.

Query access audit filtered to denied checks in the last 24 hours

Read the results​

Each row is one access check. The newest checks are at the top, 20 per page. Use Previous and Next to move between pages.

ColumnWhat it shows
TimeWhen the check happened.
UserThe user or service account that ran the query.
ResultALLOWED or DENIED.
AccessThe type of check, for example AccessCatalog for opening a catalog or SelectFromColumns for reading columns.
ResourceThe path of the resource that was checked, for example catalog/default/orders/email for one column.
QueryThe full text of the query that caused the check.

One query usually causes many checks, one for each catalog, table, or column it touches. A query fails if any of its checks is DENIED, so look for the denied row of that query.

Select Refresh to load the latest records with the same filters.

Good to know​

  • Resource category narrows the results to checks on a catalog, schema, table, column, or systemproperty.
  • Opening Data Explorer or Time Machine also runs queries, so their checks appear in the audit trail too.
  • An empty list means no check matched your filters in that time range.

Messages you may see​

MessageWhat it meansWhat to do
The audit scan is too large. Narrow the time range or add filters.The search would read too many records.Choose a shorter time range or add filters, then select Retry or Show results.
The authorization audit service is currently unavailableThe audit records cannot be read right now.Try again later.

Fix a denied query​

  1. Set Result to Denied, select More filters, and choose the person who reported the error in User.
  2. Select Show results.
  3. Find the row of the failed query and note its Access and Resource, for example SelectFromColumns on catalog/default/orders/email.
  4. Grant the matching permission in an access policy, or confirm that the denial is intended.

Next steps​