Table
laktory.models.resources.databricks.Table
¤
Bases: UnityCatalogMixin, TableBase
A table resides in the third layer of Unity Catalog’s three-level namespace. It contains rows of data.
Examples:
import io
from laktory import models
table_yaml = '''
name: slv_stock_prices
catalog_name: dev
schema_name: finance
table_type: MANAGED
grants:
- principal: account users
privileges:
- SELECT
'''
table = models.resources.databricks.Table.model_validate_yaml(
io.StringIO(table_yaml)
)
References
| BASE | DESCRIPTION |
|---|---|
catalog_name
|
Name of parent catalog. Change forces the creation of a new resource
TYPE:
|
cluster_id
|
All table CRUD operations must be executed on a running cluster or SQL warehouse. If a cluster_id is specified, it will be used to execute SQL commands to manage this table. If empty, a cluster will be created automatically with the name
TYPE:
|
cluster_keys
|
a subset of columns to liquid cluster the table by. For automatic clustering, set
TYPE:
|
column
|
TYPE:
|
comment
|
User-supplied free-form text
TYPE:
|
data_source_format
|
External tables are supported in multiple data source formats. The string constants identifying these formats are
TYPE:
|
name
|
User-visible name of column
TYPE:
|
options
|
Map of user defined table options. Change forces creation of a new resource
TYPE:
|
owner
|
User name/group name/sp application_id of the table owner
TYPE:
|
partitions
|
a subset of columns to partition the table by. Change forces the creation of a new resource. Conflicts with
TYPE:
|
properties
|
A map of table properties
TYPE:
|
schema_name
|
Name of parent Schema relative to parent Catalog. Change forces the creation of a new resource
TYPE:
|
storage_credential_name
|
For EXTERNAL Tables only: the name of storage credential to use. Change forces the creation of a new resource
TYPE:
|
storage_location
|
URL of storage location for Table data (required for EXTERNAL Tables). If the URL contains special characters, such as space,
TYPE:
|
table_type
|
Distinguishes a view vs. managed/external Table.
TYPE:
|
view_definition
|
SQL text defining the view (for
TYPE:
|
warehouse_id
|
All table CRUD operations must be executed on a running cluster or SQL warehouse. If a
TYPE:
|
| LAKTORY | DESCRIPTION |
|---|---|
grant
|
Non-destructive grant for specific principal(s). Adds or updates privileges for the listed principal(s) and leaves
grants for all other principals untouched. Use when access is managed from multiple sources (Laktory, Databricks
UI, etc.). Mutually exclusive with
TYPE:
|
grants
|
Authoritative grant list for all principals. Replaces every existing grant on this Table - including those set
outside Laktory - with only the entries listed here. Use only when Laktory owns all access management for this
resource. Mutually exclusive with
TYPE:
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
additional_core_resources |
TYPE:
|
column_names |
List of column names
TYPE:
|
full_name |
Table full name
TYPE:
|
is_from_cdc |
If
TYPE:
|
parent_full_name |
Parent namespace in the UC three-level hierarchy
TYPE:
|
additional_core_resources
property
¤
- table grants
column_names
property
¤
List of column names
full_name
property
¤
Table full name {catalog_name}.{schema_name}.{table_name}
is_from_cdc
property
¤
If True CDC source is used to build the table
parent_full_name
property
¤
Parent namespace in the UC three-level hierarchy
laktory.models.resources.databricks.table.TableColumn
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
comment
|
User-supplied free-form text
TYPE:
|
identity
|
Whether the field is an identity column. Can be
TYPE:
|
name
|
User-visible name of column
TYPE:
|
nullable
|
Whether field is nullable (Default:
TYPE:
|
type
|
Column type spec (with metadata) as SQL text. Not supported for
TYPE:
|
type_json
|
TYPE:
|
laktory.models.resources.databricks.table.TableLookup
¤
Bases: ResourceLookup
| PARAMETER | DESCRIPTION |
|---|---|
name
|
Full name of the databricks_table:
TYPE:
|