DESCRIBE ICEBERG TABLE

描述 Apache Iceberg™ 表 中的列或 Iceberg 表属性的当前值和默认值。

DESCRIBE 可以缩写为 DESC。

请注意,本主题将 Iceberg 表简称为“表”,除非指定 Iceberg 表 以避免混淆。

另请参阅:

ALTER ICEBERG TABLEDROP ICEBERG TABLECREATE ICEBERG TABLESHOW ICEBERG TABLES

语法

DESC[RIBE] [ ICEBERG ] TABLE <name> [ TYPE =  { COLUMNS | STAGE } ]
Copy

参数

name

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

TYPE = COLUMNS | STAGE

指定是显示表的列,还是显示表的暂存属性(包括其当前值和默认值)。

默认:TYPE = COLUMNS

访问控制要求

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

权限

对象

备注

SELECT

Iceberg 表

The USAGE privilege on the parent database and schema are required to perform operations on any object in a schema. Note that a role granted any privilege on a schema allows that role to resolve the schema. For example, a role granted CREATE privilege on a schema can create objects on that schema without also having USAGE granted on that schema.

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

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

使用说明

  • 此命令不显示表的对象参数。请改用 SHOW PARAMETERS IN TABLE

  • DESC ICEBERG TABLE、DESCRIBE TABLEDESCRIBE VIEW 是可互换的。这些命令中的任何一条都可以检索与语句中的条件相匹配的表或视图的详细信息;但是 TYPE = STAGE 不适用于视图,因为该视图没有暂存属性。

  • 输出包括一个 POLICY NAME 列,用于指示在列上设置的 掩码策略

    如果未在该列上设置掩码策略,或者 Snowflake 账户不是 Enterprise Edition 或更高版本,Snowflake 将返回 NULL

  • 如果您为 Iceberg 表基于的 Delta 表配置 Iceberg Compatibility V2 (icebergCompatV2 (https://github.com/delta-io/delta/blob/master/PROTOCOL.md#iceberg-compatibility-v2)),则该命令会返回 NAME_MAPPING 列。

    备注

    要查看 NAME_MAPPING 列,您还必须在账户中启用 2025_01 行为变更捆绑包。

    在账户中启用此捆绑包,请执行以下语句:

    SELECT SYSTEM$ENABLE_BEHAVIOR_CHANGE_BUNDLE('2025_01');
    
    Copy
  • 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.

    The output column names for this command are generated in lowercase. If you consume a result set from this command with the pipe operator or the RESULT_SCAN function, use double-quoted identifiers for the column names in the query to ensure that they match the column names in the output that was scanned. For example, if the name of an output column is type, then specify "type" for the identifier.

示例

创建一个 Iceberg 表示例:

CREATE OR REPLACE ICEBERG TABLE my_iceberg_table
  CATALOG='my_catalog_integration'
  EXTERNAL_VOLUME='my_ext_volume'
  METADATA_FILE_PATH='path/to/metadata/v2.metadata.json';
Copy

描述表中的列:

DESC ICEBERG TABLE my_iceberg_table ;
Copy
语言: 中文