©2024 Databricks Inc. — All rights reserved
Step 2 : Prepare dataset
SELECT
event_date,
user_identity.email,
request_params.notebookId, request_params.clusterId, request_params.executionTime,
request_params.status, request_params.commandLanguage, request_params.commandId,
request_params.commandText
FROM system.access.audit
WHERE 1=1
AND action_name = 'runCommand'
AND request_params.status NOT IN ('skipped')
AND TIMESTAMPDIFF(HOUR, event_date, CURRENT_TIMESTAMP()) < 24 * 90
ORDER BY request_params.executionTime DESC
SELECT
action_name as `EVENT`,
event_time as `WHEN`,
IFNULL(request_params.full_name_arg, 'Non-specific') AS `TABLE ACCESSED`,
IFNULL(request_params.commandText,'GET table') AS `QUERY TEXT`
FROM system.access.audit
WHERE user_identity.email like '
[email protected]'
AND action_name IN ('createTable', 'commandSubmit','getTable','deleteTable')
AND datediff(now(), event_date) < 1
Query Sample
Identify long-running queries and track inefficient code running through
Notebooks with System Tables and Lakeview