SQL Warehouses

Package: databricks.bundles.sql_warehouses

Classes

class Channel

Configures the channel name and DBSQL version of the warehouse. CHANNEL_NAME_CUSTOM should be chosen only when dbsql_version is specified.

dbsql_version: str | None = None

Databricks SQL version to pin to. Set it if and only if name is CHANNEL_NAME_CUSTOM.

name: ChannelName | None = None

Channel to follow. CHANNEL_NAME_CURRENT is the default, and CHANNEL_NAME_PREVIEW carries the upcoming Databricks SQL release for testing.

classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class ChannelName
CHANNEL_NAME_PREVIEW = 'CHANNEL_NAME_PREVIEW'
CHANNEL_NAME_CURRENT = 'CHANNEL_NAME_CURRENT'
CHANNEL_NAME_PREVIOUS = 'CHANNEL_NAME_PREVIOUS'
CHANNEL_NAME_CUSTOM = 'CHANNEL_NAME_CUSTOM'
class CreateWarehouseRequestWarehouseType
TYPE_UNSPECIFIED = 'TYPE_UNSPECIFIED'
CLASSIC = 'CLASSIC'
PRO = 'PRO'
REALTIME = 'REALTIME'
class DependsOn
resource: str

Key of the resource to depend on, as foo or jobs.foo, or of its grants or permissions, as schemas.foo.grants.

classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class EndpointTagPair
key: str | None = None

Tag key. Keys must be unique within the warehouse and cannot use the keys that Databricks reserves for the tags it sets automatically.

value: str | None = None

Tag value. Keys and values must follow the tagging rules of the cloud provider.

classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class EndpointTags
custom_tags: list[EndpointTagPair]

User-defined tags, applied in addition to the tags Databricks sets automatically.

classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class LifecycleWithStarted
depends_on: list[DependsOn]

Resources that must be deployed before this resource and deleted after it. Unlike variable references, this only affects ordering.

prevent_destroy: bool | None = None

Lifecycle setting to prevent the resource from being destroyed.

started: bool | None = None

Lifecycle setting to deploy the resource in started mode. Only supported for apps, clusters, and sql_warehouses.

classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class SpotInstancePolicy

EndpointSpotInstancePolicy configures whether the endpoint should use spot instances.

The breakdown of how the EndpointSpotInstancePolicy converts to per cloud configurations is:

  • AWS, COST_OPTIMIZED: On Demand Driver with Spot Executors.

  • AWS, RELIABILITY_OPTIMIZED: On Demand Driver and Executors.

  • AZURE, COST_OPTIMIZED: On Demand Driver and Executors.

  • AZURE, RELIABILITY_OPTIMIZED: On Demand Driver and Executors.

POLICY_UNSPECIFIED = 'POLICY_UNSPECIFIED'
COST_OPTIMIZED = 'COST_OPTIMIZED'
RELIABILITY_OPTIMIZED = 'RELIABILITY_OPTIMIZED'
class SqlWarehouse

Creates a new SQL warehouse.

auto_stop_mins: int | None = None

The amount of time in minutes that a SQL warehouse must be idle (i.e., no RUNNING queries) before it is automatically stopped.

Supported values: - Must be == 0 or >= 1 min for serverless warehouses. - Must be == 0 or >= 10 mins for classic and pro warehouses. - 0 indicates no autostop.

Defaults to 120 mins

channel: Channel | None = None

Channel that determines which Databricks SQL version the warehouse runs.

cluster_size: str | None = None

Size of the clusters allocated for this warehouse. Increasing the size of a spark cluster allows you to run larger queries on it. If you want to increase the number of concurrent queries, please tune max_num_clusters.

Supported values: - 2X-Small - X-Small - Small - Medium - Large - X-Large - 2X-Large - 3X-Large - 4X-Large - 5X-Large

creator_name: str | None = None

Name of the user who created the warehouse. Set by the server and ignored in requests.

enable_photon: bool | None = None

Configures whether the warehouse should use Photon optimized clusters.

Defaults to true.

enable_serverless_compute: bool | None = None

Configures whether the warehouse should use serverless compute

instance_profile_arn: str | None = None

[DEPRECATED] Deprecated. Instance profile used to pass IAM role to the cluster

lifecycle: LifecycleWithStarted | None = None

Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed.

max_num_clusters: int | None = None

Maximum number of clusters that the autoscaler will create to handle concurrent queries.

Supported values: - Must be >= min_num_clusters - Must be <= 40.

Defaults to min_clusters if unset.

min_num_clusters: int | None = None

Minimum number of available clusters that will be maintained for this SQL warehouse. Increasing this will ensure that a larger number of clusters are always running and therefore may reduce the cold start time for new queries. This is similar to reserved vs. revocable cores in a resource manager.

Supported values: - Must be > 0 - Must be <= min(max_num_clusters, 30)

Defaults to 1

name: str | None = None

Logical name for the warehouse.

Supported values: - Must be unique within an org. - Must be 1 to 100 characters.

permissions: list[SqlWarehousePermission]

The permissions to apply to this resource.

spot_instance_policy: SpotInstancePolicy | None = None

Configures whether the warehouse should use spot instances. COST_OPTIMIZED uses spot instances where the cloud provider supports them, and RELIABILITY_OPTIMIZED uses on-demand instances only.

statement_timeout: int | None = None

Maximum time in seconds that a statement can run on this warehouse before it is cancelled. Set to 0 to remove the warehouse-level timeout. Changing the value of a running warehouse restarts it. See https://docs.databricks.com/aws/en/sql/language-manual/parameters/statement_timeout.

tags: EndpointTags | None = None

A set of key-value pairs that will be tagged on all resources (e.g., AWS instances and EBS volumes) associated with this SQL warehouse.

Supported values: - Number of tags < 45.

warehouse_type: CreateWarehouseRequestWarehouseType | None = None

Warehouse type: PRO, CLASSIC, or REALTIME. For serverless compute, use PRO or REALTIME with enable_serverless_compute=true. REALTIME requires serverless compute and Photon; enable_photon defaults to true.

classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class SqlWarehousePermission
level: WarehousePermissionLevel

The permission level to apply. The allowed levels depend on the resource type.

group_name: str | None = None

The name of the group granted the permission level.

service_principal_name: str | None = None

The name of the service principal granted the permission level.

user_name: str | None = None

The name of the user granted the permission level.

classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class WarehousePermissionLevel

Permission level

CAN_MANAGE = 'CAN_MANAGE'
IS_OWNER = 'IS_OWNER'
CAN_USE = 'CAN_USE'
CAN_MONITOR = 'CAN_MONITOR'
CAN_VIEW = 'CAN_VIEW'