warehouses
Operations on a warehouses
resource.
Overview
Name | warehouses |
Type | Resource |
Id | databricks_workspace.dbsql.warehouses |
Fields
Name | Datatype |
---|---|
id | string |
name | string |
auto_stop_mins | string |
channel | object |
cluster_size | string |
creator_name | string |
enable_photon | boolean |
enable_serverless_compute | boolean |
health | object |
instance_profile_arn | string |
jdbc_url | string |
max_num_clusters | integer |
min_num_clusters | string |
num_active_sessions | integer |
num_clusters | integer |
odbc_params | object |
spot_instance_policy | string |
state | string |
tags | object |
warehouse_type | string |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | id, deployment_name | Gets the information for a single SQL warehouse. |
list | SELECT | deployment_name | Lists all SQL warehouses that a user has manager permissions on. |
create | INSERT | deployment_name | Creates a new SQL warehouse. |
delete | DELETE | id, deployment_name | Deletes a SQL warehouse. |
edit | REPLACE | id, deployment_name | Updates the configuration for a SQL warehouse. |
start | EXEC | id, deployment_name | Starts a SQL warehouse. |
stop | EXEC | id, deployment_name | Stops a SQL warehouse. |
SELECT
examples
- warehouses (list)
- warehouses (get)
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 }}';
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 id = '{{ id }}' AND
deployment_name = '{{ deployment_name }}';
INSERT
example
Use the following StackQL query and manifest file to create a new warehouses
resource.
- warehouses
- Manifest
/*+ 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 }}'
;
- name: your_resource_model_name
props:
- name: name
value: string
- name: cluster_size
value: string
- name: min_num_clusters
value: '1'
- name: max_num_clusters
value: 0
- name: auto_stop_mins
value: '120'
- name: creator_name
value: string
- name: instance_profile_arn
value: string
- name: tags
value:
custom_tags:
- key: string
value: string
- name: spot_instance_policy
value: POLICY_UNSPECIFIED
- name: enable_photon
value: true
- name: channel
value:
name: CHANNEL_NAME_PREVIEW
dbsql_version: string
- name: enable_serverless_compute
value: true
- name: warehouse_type
value: TYPE_UNSPECIFIED
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 }}';