Databricks Schema
materialized
The materialized block describes a materialized view in a database schema.
materialized "name" {
schema = schema.public
column "total" {
null = true
type = numeric
}
...
}
materialized attributes
| Name | Required | Value |
|---|---|---|
as | true | string |
schema | true | Object reference to |
materialized constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., materialized "name" ) | true |
Allow Qualifier (e.g., materialized "schema" "name" ) | true |
schema
The schema block describes a database schema.
schema "public" {
...
}
schema constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., schema "name" ) | true |
table
The table block describes a table in a database schema.
table "users" {
schema = schema.public
column "id" {
type = int
}
...
}
table attributes
| Name | Required | Value |
|---|---|---|
properties | false | map |
schema | true | Object reference to |
table blocks
table.check
table.check attributes
| Name | Required | Value |
|---|---|---|
expr | true | string |
table.check constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., table.check "name" ) | true |
| Repeatable | true |
table.cluster
table.cluster attributes
| Name | Required | Value |
|---|---|---|
columns | false | List of object reference to |
table.column
table.column attributes
| Name | Required | Value |
|---|---|---|
default | false | Column default expression can be one of:
|
null | false | bool |
type | true | Column type can be one of:
|
table.column constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., table.column "name" ) | true |
table.foreign_key
table.foreign_key attributes
| Name | Required | Value |
|---|---|---|
columns | true | Foreign key columns can be one of:
|
ref_columns | true | Foreign key reference columns can be one of:
|
table.foreign_key constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., table.foreign_key "name" ) | true |
table.partition
table.partition attributes
| Name | Required | Value |
|---|---|---|
columns | false | List of object reference to |
table.primary_key
table.primary_key attributes
| Name | Required | Value |
|---|---|---|
columns | true | Primary key columns can be one of:
|
table constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., table "name" ) | true |
Allow Qualifier (e.g., table "schema" "name" ) | true |
view
The view block describes a view in a database schema.
view "clean_users" {
schema = schema.public
column "id" {
type = int
}
...
}
view attributes
| Name | Required | Value |
|---|---|---|
as | true | string |
schema | true | Object reference to |
view constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., view "name" ) | true |
Allow Qualifier (e.g., view "schema" "name" ) | true |