Skip to main content

warehouses

Operations on a warehouses resource.

Overview

Namewarehouses
TypeResource
Iddatabricks_workspace.dbsql.warehouses

Fields

NameDatatype
idstring
namestring
auto_stop_minsstring
channelobject
cluster_sizestring
creator_namestring
enable_photonboolean
enable_serverless_computeboolean
healthobject
instance_profile_arnstring
jdbc_urlstring
max_num_clustersinteger
min_num_clustersstring
num_active_sessionsinteger
num_clustersinteger
odbc_paramsobject
spot_instance_policystring
statestring
tagsobject
warehouse_typestring

Methods

NameAccessible byRequired ParamsDescription
getSELECTid, deployment_nameGets the information for a single SQL warehouse.
listSELECTdeployment_nameLists all SQL warehouses that a user has manager permissions on.
createINSERTdeployment_nameCreates a new SQL warehouse.
deleteDELETEid, deployment_nameDeletes a SQL warehouse.
editREPLACEid, deployment_nameUpdates the configuration for a SQL warehouse.
startEXECid, deployment_nameStarts a SQL warehouse.
stopEXECid, deployment_nameStops a SQL warehouse.

SELECT examples

SELECT
id,
name,
auto_stop_mins,
channel,
cluster_size,
creator_name,
enable_photon,
enable_serverless_compute,
health,
instance_profile_arn,
jdbc_url,
max_num_clusters,
min_num_clusters,
num_active_sessions,
num_clusters,
odbc_params,
spot_instance_policy,
state,
tags,
warehouse_type
FROM databricks_workspace.dbsql.warehouses
WHERE deployment_name = '{{ deployment_name }}';

INSERT example

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

/*+ create */
INSERT INTO databricks_workspace.dbsql.warehouses (
deployment_name,
data__name,
data__cluster_size,
data__min_num_clusters,
data__max_num_clusters,
data__auto_stop_mins,
data__creator_name,
data__instance_profile_arn,
data__tags,
data__spot_instance_policy,
data__enable_photon,
data__channel,
data__enable_serverless_compute,
data__warehouse_type
)
SELECT
'{{ deployment_name }}',
'{{ name }}',
'{{ cluster_size }}',
'{{ min_num_clusters }}',
'{{ max_num_clusters }}',
'{{ auto_stop_mins }}',
'{{ creator_name }}',
'{{ instance_profile_arn }}',
'{{ tags }}',
'{{ spot_instance_policy }}',
'{{ enable_photon }}',
'{{ channel }}',
'{{ enable_serverless_compute }}',
'{{ warehouse_type }}'
;

REPLACE example

Replaces a warehouses resource.

/*+ update */
-- replace field1, field2, etc. with the fields you want to update
REPLACE databricks_workspace.dbsql.warehouses
SET field1 = '{ value1 }',
field2 = '{ value2 }', ...
WHERE id = '{{ id }}' AND
deployment_name = '{{ deployment_name }}';

DELETE example

Deletes a warehouses resource.

/*+ delete */
DELETE FROM databricks_workspace.dbsql.warehouses
WHERE id = '{{ id }}' AND
deployment_name = '{{ deployment_name }}';