Skip to main content

online_tables

Creates, updates, deletes, gets or lists an online_tables resource.

Overview

Nameonline_tables
TypeResource
Iddatabricks_workspace.catalog.online_tables

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringFull three-part (catalog, schema, table) name of the table.
specobjectSpecification of the online table.
statusobjectOnline Table data synchronization status
table_serving_urlstringData serving REST API URL for this table
unity_catalog_provisioning_statestringThe provisioning state of the online table entity in Unity Catalog. This is distinct from the state of the data synchronization pipeline (i.e. the table may be in "ACTIVE" but the pipeline may be in "PROVISIONING" as it runs asynchronously). (ACTIVE, DEGRADED, DELETING, FAILED, PROVISIONING, UPDATING)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectname, deployment_nameGet information about an existing online table and its status.
createinsertdeployment_name, tableCreate a new Online Table.
deletedeletename, deployment_nameDelete an online table. Warning: This will delete all the data in the online table. If the source

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
deployment_namestringThe Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc)
namestringFull three-part (catalog, schema, table) name of the table.

SELECT examples

Get information about an existing online table and its status.

SELECT
name,
spec,
status,
table_serving_url,
unity_catalog_provisioning_state
FROM databricks_workspace.catalog.online_tables
WHERE name = '{{ name }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
;

INSERT examples

Create a new Online Table.

INSERT INTO databricks_workspace.catalog.online_tables (
table,
deployment_name
)
SELECT
'{{ table }}' /* required */,
'{{ deployment_name }}'
RETURNING
name,
spec,
status,
table_serving_url,
unity_catalog_provisioning_state
;

DELETE examples

Delete an online table. Warning: This will delete all the data in the online table. If the source

DELETE FROM databricks_workspace.catalog.online_tables
WHERE name = '{{ name }}' --required
AND deployment_name = '{{ deployment_name }}' --required
;