本文详细介绍了 dbt 作业(DataBuildToolJob)项的定义结构。
定义部件
此表列出了定义部件。
| 定义部件路径 |
类型 |
必选 |
Description |
dbtjob-content.json |
ContentDetails (JSON) |
是 |
描述项的属性和设置,如配置文件和作 |
.platform |
PlatformDetails (JSON) |
假 |
描述项的常见详细信息 |
ContentDetails
描述有效负载的内容
DbtJobProject 内容的说明
| Name |
类型 |
必选 |
Description |
| projectType 项目类型 |
String |
是 |
dbt 项目的类型。 可能的值:OneLake、Lakehouse。 |
| 文件夹路径 |
String |
假 |
dbt 项目文件夹的路径。 |
| connectionSettings |
DbtJobConnectionSettings |
是 |
dbt 项目的连接设置。 |
DbtJobProfile 内容的说明
描述 dbt 配置文件的字段。 此处,可以使用 connectionSettings 或 externalReferences,具体取决于类型。
DbtJobCommand 内容的说明
| Name |
类型 |
必选 |
Description |
| 操作 |
String |
是 |
dbt 命令的类型。 可能的值:run、、build、showseed、compile、test。 snapshot |
| arguments |
DbtJobCommandArgument |
假 |
dbt 命令的其他参数。 |
DbtJobCommandArgument 内容的说明
| Name |
类型 |
必选 |
Description |
| 选择 |
String |
假 |
要包含的模型的逗号分隔列表。 |
| 排除 |
String |
假 |
要排除的模型的逗号分隔列表。 |
| fullRefresh |
布尔 |
假 |
指定 dbt 是否应重新生成所有模型。 |
| failFast |
布尔 |
假 |
指定一旦模型失败,dbt 是否应立即退出。 |
| threads |
整数 |
假 |
指定要使用的线程数。 |
| selectorName |
String |
假 |
指定要使用的选择器。 |
ExternalReferences 内容的说明
| Name |
类型 |
必选 |
Description |
| 连接 |
字符串 (Guid) |
是 |
指定连接的 ID。 |
DbtJobConnectionSettings 内容的说明
描述连接设置的字段。
DbtJobConnectionTypeProperties 内容的说明
| Name |
类型 |
必选 |
Description |
| workspaceId |
字符串 (Guid) |
是 |
指定连接项所在的工作区的 ID。 |
| artifactId |
字符串 (Guid) |
是 |
指定连接的项的 ID。 |
| 根文件夹 |
String |
假 |
指定根文件夹。 |
| 终结点 |
String |
假 |
指定终结点。 |
ContentDetails 示例 1
{
"project": {
"projectType": "OneLake",
"connectionSettings": {
"type": "OneLake"
}
},
"profile": {
"profileType": "DataWarehouse",
"schema": "analytics_schema",
"connectionSettings": {
"type": "DataWarehouse",
"properties": {
"workspaceId": "00000000-0000-0000-0000-000000000000",
"artifactId": "cccccccc-3333-4444-5555-dddddddddddd"
}
}
},
"command": {
"operation": "run",
"arguments": {
"select": "model_a,model_b",
"fullRefresh": true,
"threads": 4
}
}
}
ContentDetails 示例 2
{
"project": {
"projectType": "OneLake",
"connectionSettings": {
"type": "OneLake"
}
},
"profile": {
"profileType": "PostgreSql",
"schema": "analytics_schema",
"externalReferences": {
"connection": "bbbbbbbb-9999-aaaa-bbbb-cccccccccccc"
}
},
"command": {
"operation": "build",
"arguments": {
"fullRefresh": true,
"failFast": true
}
}
}