Skip to content

Latest commit

 

History

History
61 lines (44 loc) · 4.63 KB

sql_warehouse.md

File metadata and controls

61 lines (44 loc) · 4.63 KB
subcategory
Databricks SQL

databricks_sql_warehouse Data Source

-> Note If you have a fully automated setup with workspaces created by databricks_mws_workspaces or azurerm_databricks_workspace, please make sure to add depends_on attribute in order to prevent default auth: cannot configure default credentials errors.

Retrieves information about a databricks_sql_warehouse using its id. This could be retrieved programmatically using databricks_sql_warehouses data source.

Example usage

Retrieve attributes of each SQL warehouses in a workspace

data "databricks_sql_warehouses" "all" {
}

data "databricks_sql_warehouse" "all" {
  for_each = data.databricks_sql.warehouses.ids
  id       = each.value
}

Argument reference

  • id - (Required) The ID of the SQL warehouse

Attribute reference

This data source exports the following attributes:

  • name - Name of the SQL warehouse. Must be unique.

  • cluster_size - The size of the clusters allocated to the warehouse: "2X-Small", "X-Small", "Small", "Medium", "Large", "X-Large", "2X-Large", "3X-Large", "4X-Large".

  • min_num_clusters - Minimum number of clusters available when a SQL warehouse is running.

  • max_num_clusters - Maximum number of clusters available when a SQL warehouse is running.

  • auto_stop_mins - Time in minutes until an idle SQL warehouse terminates all clusters and stops.

  • tags - Databricks tags all warehouse resources with these tags.

  • spot_instance_policy - The spot policy to use for allocating instances to clusters: COST_OPTIMIZED or RELIABILITY_OPTIMIZED.

  • enable_photon - Whether to enable Photon.

  • enable_serverless_compute - Whether this SQL warehouse is a serverless SQL warehouse. If this value is true explicitly or through the default, you must also set warehouse_type field to pro.

  • warehouse_type - SQL warehouse type. See for AWS or Azure. Set to PRO or CLASSIC (default). If you want to use serverless compute, you must set to PRO and also set the field enable_serverless_compute to true.

  • channel block, consisting of following fields:

    • name - Name of the Databricks SQL release channel. Possible values are: CHANNEL_NAME_PREVIEW and CHANNEL_NAME_CURRENT. Default is CHANNEL_NAME_CURRENT.
  • jdbc_url - JDBC connection string.

  • odbc_params - ODBC connection params: odbc_params.hostname, odbc_params.path, odbc_params.protocol, and odbc_params.port.

  • data_source_id - ID of the data source for this warehouse. This is used to bind an Databricks SQL query to an warehouse.

Related resources

The following resources are often used in the same context: