Automatic upgrades system table reference
This system table is in Public Preview.
This page describes the automatic upgrades operation history table schema and shows sample queries. Automatic upgrades automatically turn on best-practice features on your Unity Catalog managed tables without requiring code changes. The system table tracks the history of these operations. For information on automatic upgrades, see Automatic upgrades.
Table path: This system table is located at system.storage.table_auto_upgrade_operations_history.
Automatic upgrades table schema
The automatic upgrades operation history system table uses the following schema:
Column name | Data type | Description | Example |
|---|---|---|---|
| string | The ID of the account. |
|
| string | The name of the metastore to which the upgraded table belongs. |
|
| string | The ID of the metastore to which the upgraded table belongs. |
|
| string | The name of the catalog to which the upgraded table belongs. |
|
| string | The name of the schema to which the upgraded table belongs. |
|
| string | The name of the upgraded table. |
|
| string | The ID of the upgraded table. |
|
| string | The table feature that automatic upgrades attempted to turn on, such as |
|
| string | The unique ID for the operation. |
|
| string | The type of operation. Values include |
|
| string | The result of an attempted upgrade operation. Values include |
|
| timestamp | The time at which the operation started. Timezone information is recorded at the end of the value with |
|
| timestamp | The time at which the operation ended. Timezone information is recorded at the end of the value with |
|
operation_result values
The operation_result column shows whether an attempted upgrade operation succeeded or failed to turn on a feature, recorded in feature_name, on an eligible table. If failed (message FAILED: INTERNAL_ERROR), you can enable the feature manually.
Example queries
The following sections include sample queries you can use to gain insights into the automatic upgrades system table. You must replace the parameter values with your own values.
Query automatic upgrade operations for all features on a specific table
SELECT
feature_name,
operation_result,
start_time,
end_time
FROM system.storage.table_auto_upgrade_operations_history
WHERE
catalog_name = :catalog_name
AND schema_name = :schema_name
AND table_name = :table_name
ORDER BY start_time DESC;
Query the number of automatic upgrade operations in the last 30 days
SELECT
feature_name,
operation_result,
COUNT(DISTINCT operation_id) AS operations
FROM system.storage.table_auto_upgrade_operations_history
WHERE timestampdiff(day, start_time, NOW()) < 30
GROUP BY ALL
ORDER BY operations DESC;
Query the the success rate for automatic upgrades operations
WITH operation_counts AS (
SELECT
COUNT(DISTINCT (CASE WHEN operation_result = "SUCCESSFUL" THEN operation_id END)) AS successes,
COUNT(DISTINCT operation_id) AS total_operations
FROM system.storage.table_auto_upgrade_operations_history
)
SELECT successes / total_operations AS success_rate
FROM operation_counts;
Query for automatic upgrade operations that failed
SELECT
catalog_name,
schema_name,
table_name,
feature_name,
start_time
FROM system.storage.table_auto_upgrade_operations_history
WHERE operation_result != "SUCCESSFUL"
ORDER BY start_time DESC;