Table
laktory.models.resources.databricks.Table
¤
Bases: 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 the catalog storing the table
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 the schema storing the table
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
|
Grant(s) operating on the Table and authoritative for a specific principal. Other principals within the grants are
preserved. Mutually exclusive with
TYPE:
|
grants
|
Grants operating on the Table and authoritative for all principals. Replaces any existing grants defined inside or
outside of Laktory. 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 |
Schema full name
TYPE:
|
resource_key |
Table full name (catalog.schema.table)
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
¤
Schema full name {catalog_name}.{schema_name}
resource_key
property
¤
Table full name (catalog.schema.table)
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:
|