Doris/SelectDB configurations
Models
Type | Supported? | Details |
---|---|---|
view materialization | YES | Creates a view. |
table materialization | YES | Creates a table. |
incremental materialization | YES | Creates a table if it doesn't exist, and then item table model must be 'unique'. |
View Materialization
A dbt model can be created as a Doris view and configured using the following syntax:
- Project file
- Config block
dbt_project.yml
models:
<resource-path>:
+materialized: view
models/<model_name>.sql
{{ config(materialized = "view") }}
Table Materialization
A dbt model can be created as a Doris table and configured using the following syntax:
- Project file
- Config block
dbt_project.yml
models:
<resource-path>:
+materialized: table
+duplicate_key: [ <column-name>, ... ],
+partition_by: [ <column-name>, ... ],
+partition_type: <engine-type>,
+partition_by_init: [<pertition-init>, ... ]
+distributed_by: [ <column-name>, ... ],
+buckets: int,
+properties: {<key>:<value>,...}
models/<model_name>.sql
{{ config(
materialized = "table",
duplicate_key = [ "<column-name>", ... ],
partition_by = [ "<column-name>", ... ],
partition_type = "<engine-type>",
partition_by_init = ["<pertition-init>", ... ]
distributed_by = [ "<column-name>", ... ],
buckets = "int",
properties = {"<key>":"<value>",...}
...
]
) }}
Table Configuration
Option | Description | Required? |
---|---|---|
materialized | How the model will be materialized into Doris. Must be table to create a table model. | Required |
duplicate_key | The key list of Doris table model :'duplicate'. | Required |
partition_by | The partition key list of Doris. (Doris partition) | Optional |
partition_type | The partition type of Doris. | Optional (default: RANGE ) |
partition_by_init | The partition rule or some real partitions item. | Optional |
distributed_by | The bucket key list of Doris. (Doris distribute) | Required |
buckets | The bucket number in one Doris partition. | Required |
properties | The other configuration of Doris. (Doris properties) | Required |
Incremental Materialization
An incremental Doris table, item table model must be 'unique' and is configured using the following syntax:
- Project file
- Config block
dbt_project.yml
models:
<resource-path>:
+materialized: incremental
+unique_key: [ <column-name>, ... ],
+partition_by: [ <column-name>, ... ],
+partition_type: <engine-type>,
+partition_by_init: [<pertition-init>, ... ]
+distributed_by: [ <column-name>, ... ],
+buckets: int,
+properties: {<key>:<value>,...}
models/<model_name>.sql
{{ config(
materialized = "incremental",
unique_key = [ "<column-name>", ... ],
partition_by = [ "<column-name>", ... ],
partition_type = "<engine-type>",
partition_by_init = ["<pertition-init>", ... ]
distributed_by = [ "<column-name>", ... ],
buckets = "int",
properties = {"<key>":"<value>",...}
...
]
) }}
Incremental Table Configuration
Option | Description | Required? |
---|---|---|
materialized | How the model will be materialized into Doris. Must be table to create a table model. | Required |
unique_key | The key list of Doris table model :'Doris unique'. | Required |
partition_by | The partition key list of Doris. (Doris partition) | Optional |
partition_type | The partition type of Doris. | Optional (default: RANGE ) |
partition_by_init | The partition rule or some real partitions item. | Optional |
distributed_by | The bucket key list of Doris. (Doris distribute) | Required |
buckets | The bucket number in one Doris partition. | Required |
properties | The other configuration of Doris. (Doris properties) | Required |
0