Skip to main content

online_tables

Operations on a online_tables resource.

Overview

Nameonline_tables
TypeResource
Iddatabricks_workspace.unitycatalog.online_tables

Fields

NameDatatype
namestring
specobject
statusobject
table_serving_urlstring
unity_catalog_provisioning_statestring

Methods

NameAccessible byRequired ParamsDescription
getSELECTname, deployment_nameGet information about an existing online table and its status.
createINSERTdeployment_nameCreate a new Online Table.
deleteDELETEname, deployment_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!

SELECT examples

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

INSERT example

Use the following StackQL query and manifest file to create a new online_tables resource.

/*+ create */
INSERT INTO databricks_workspace.unitycatalog.online_tables (
deployment_name,
data__name,
data__spec
)
SELECT
'{{ deployment_name }}',
'{{ name }}',
'{{ spec }}'
;

DELETE example

Deletes a online_tables resource.

/*+ delete */
DELETE FROM databricks_workspace.unitycatalog.online_tables
WHERE name = '{{ name }}' AND
deployment_name = '{{ deployment_name }}';