Skip to main content

vw_branches

Creates, updates, deletes, gets or lists a vw_branches resource.

Overview

Namevw_branches
TypeView
Iddatabricks_workspace.postgres.vw_branches

Fields

The following fields are returned by this view:

NameDatatypeDescription
namestringThe branch identifier (last component of the resource path).
create_timestringTimestamp when the branch was created.
project_idstringThe project identifier that owns this branch.
specobjectBranch specification including expiry and protection settings.
branch_idstringSystem-assigned branch identifier.
current_statestringCurrent operational state of the branch (e.g. READY, INIT).
defaultbooleanWhether this is the project's default branch.
is_protectedbooleanWhether the branch is protected from deletion and reset.
logical_size_bytesintegerLogical size of the branch in bytes.
state_change_timestringTimestamp indicating when the current_state began.
uidstringSystem-generated unique ID for the branch.
update_timestringTimestamp when the branch was last updated.

Required Parameters

The following parameters are required by this view:

NameDatatypeDescription
project_idstringThe project identifier to scope the query.
deployment_namestringThe Databricks workspace deployment name.

SELECT Examples

SELECT
name,
create_time,
project_id,
spec,
branch_id,
current_state,
default,
is_protected,
logical_size_bytes,
state_change_time,
uid,
update_time
FROM databricks_workspace.postgres.vw_branches
WHERE project_id = '{{ project_id }}'
AND deployment_name = '{{ deployment_name }}';

SQL Definition

SELECT
SPLIT_PART(name, '/', -1) AS name,
create_time,
project_id,
spec,
JSON_EXTRACT(status, '$.branch_id') AS branch_id,
JSON_EXTRACT(status, '$.current_state') AS current_state,
JSON_EXTRACT(status, '$.default') AS default,
JSON_EXTRACT(status, '$.is_protected') AS is_protected,
JSON_EXTRACT(status, '$.logical_size_bytes') AS logical_size_bytes,
JSON_EXTRACT(status, '$.state_change_time') AS state_change_time,
uid,
update_time
FROM databricks_workspace.postgres.branches
WHERE project_id = '{{ project_id }}'
AND deployment_name = '{{ deployment_name }}'