Skip to main content

online_tables

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

Overview

Nameonline_tables
TypeResource
Iddatabricks_workspace.unitycatalog.online_tables

Fields

The following fields are returned by SELECT queries:

Request completed successfully.

NameDatatypeDescription
namestring
specobject
statusobject
table_serving_urlstring
unity_catalog_provisioning_statestring

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectdeployment_nameGet information about an existing online table and its status.
createinsertdeployment_nameCreate a new Online Table.
deletedeletedeployment_nameDelete an online table. Warning: This will delete all the data in the online table. If the source Delta table was deleted or modified since this Online Table was created, this will lose the data forever!

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)

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.unitycatalog.online_tables
WHERE deployment_name = '{{ deployment_name }}' -- required;

INSERT examples

Create a new Online Table.

INSERT INTO databricks_workspace.unitycatalog.online_tables (
data__name,
data__spec,
deployment_name
)
SELECT
'{{ name }}',
'{{ spec }}',
'{{ 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 Delta table was deleted or modified since this Online Table was created, this will lose the data forever!

DELETE FROM databricks_workspace.unitycatalog.online_tables
WHERE deployment_name = '{{ deployment_name }}' --required;