DESCRIBE DBT PROJECT

描述 :doc:` dbt 项目对象 </user-guide/data-engineering/dbt-projects-on-snowflake>` 的属性。

DESCRIBE 可以缩写为 DESC。

另请参阅:

CREATE DBT PROJECTALTER DBT PROJECTEXECUTE DBT PROJECTDROP DBT PROJECTSHOW DBT PROJECTS

语法

{ DESC | DESCRIBE } DBT PROJECT <name>
Copy

参数

name

指定要描述的 dbt 对象的标识符。

如果标识符包含空格或特殊字符,则整个字符串必须放在双引号内。放在双引号内的标识符也区分大小写。

有关更多信息,请参阅 标识符要求

输出

命令的输出包括以下列,它们描述了对象的属性和元数据:

描述

name

dbt 项目对象的标识符(名称)。

owner

用于创建 dbt 项目对象的角色。

comment

与 dbt 项目对象相关的注释。

default_target

The default execution target (for example, prod or dev) used by dbt commands executed through Snowflake.

external_access_integrations

The name of the external access integrations the dbt Project is permitted to use to pull remote dependencies from dbt package hub or Github.

The following columns provide the value of a deprecated parameter:

default_version

The version of the dbt project object:

  • LAST: The most recent version of the dbt project object.

  • FIRST: The oldest version of the dbt project object.

default_version_name

The version identifier in the form VERSION$num, where num is a positive integer, for example: VERSION$1.

The version number begins at 1 when you create a dbt project object and increments by one with each new version of the dbt project object.

Snowflake increments the version identifier when you perform the following tasks:

  • Redeploy dbt project from a workspace (runs the ALTER command with the ADD VERSION option).

  • Update the project by using the ALTER DBT PROJECT command.

  • Run the Snow CLI snow dbt deploy command with the --force option.

Snowflake resets the version identifier to 1 and removes all version aliases when you run the CREATE DBT PROJECT command with the OR REPLACE option.

default_version_alias

The custom version name alias that you created for a specific version of the dbt project object using the ALTER DBT PROJECT command with the ADD VERSION option. A version name alias always maps to a specific version identifier, such as VERSION$3.

default_version_location_uri

The location URI of the default version. This is read only.

default_version_source_location_uri

The location URI of the default version’s source files in its Git object. If the dbt project object is not connected to a Git object, this is null.

dbt_snowflake_version

The Snowflake version the dbt project object is on.

访问控制要求

用于执行此操作的 角色 必须至少具有以下 权限

权限

对象

MONITOR

dbt 项目

Operating on an object in a schema requires at least one privilege on the parent database and at least one privilege on the parent schema.

有关创建具有指定权限集的自定义角色的说明,请参阅 创建自定义角色

有关对 安全对象 执行 SQL 操作的相应角色和权限授予的一般信息,请参阅 访问控制概述

使用说明

  • To post-process the output of this command, you can use the pipe operator (->>) or the RESULT_SCAN function. Both constructs treat the output as a result set that you can query.

    For example, you can use the pipe operator or RESULT_SCAN function to select specific columns from the SHOW command output or filter the rows.

    When you refer to the output columns, use double-quoted identifiers for the column names. For example, to select the output column type, specify SELECT "type".

    You must use double-quoted identifiers because the output column names for SHOW commands are in lowercase. The double quotes ensure that the column names in the SELECT list or WHERE clause match the column names in the SHOW command output that was scanned.

示例

以下示例描述了名为 my_dbt_project 的 dbt 项目对象:

DESCRIBE DBT PROJECT my_dbt_project;
Copy
+----------------+--------------+------------+-------------+-----------------+----------------------+-----------------------+---------------------------------------------------------------+-------------------------------------+-----------------------+----------------+------------------------------+
|      name      |    owner     |  comment   | dbt_version | default_version | default_version_name | default_version_alias | default_version_location_uri                                  | default_version_source_location_uri | dbt_snowflake_version | default_target | external_access_integrations |
+----------------+--------------+------------+-------------+-----------------+----------------------+-----------------------+---------------------------------------------------------------+-------------------------------------+-----------------------+----------------+------------------------------+
| my_dbt_project | ACCOUNTADMIN | My comment | 1.9.4b      | LAST            | VERSION$1            | null                  | snow://dbt/MY_DB.MY_SCHEMA.my_dbt_project/versions/version$1/ | @s1                                 | null                  | dev            | null                         |
+----------------+--------------+------------+-------------+-----------------+----------------------+-----------------------+---------------------------------------------------------------+-------------------------------------+-----------------------+----------------+------------------------------+
语言: 中文