SHOW VERSIONS IN LISTING¶
列出并提供所有列表版本的详细信息。
语法¶
SHOW VERSIONS IN LISTING <name>
[ LIMIT <rows> ]
参数¶
name指定列表标识符(名称)。如果标识符包含空格或特殊字符,则整个字符串必须放在双引号内。放在双引号内的标识符也区分大小写。
有关更多信息,请参阅 标识符要求。
LIMIT rows(可选)限制返回的最大行数,同时还对结果启用“分页”功能。返回的实际行数可能小于指定的限制。例如,现有对象的数量小于指定的限制。
输出¶
命令的输出包括以下列,它们描述了对象的属性和元数据:
列 |
描述 |
|---|---|
|
版本的创建日期和时间。 |
|
系统生成的版本名称。 |
|
用户指定的版本别名。 |
|
版本的完整 URL,可以对其执行暂存区操作。 |
|
用于标识已发布的列表版本。 |
|
用于标识该版本是否为列表的实时版本。 |
|
用于标识该版本是否为首个列表版本。 |
|
用于标识该版本是否为最后的列表版本。 |
|
列表版本的注释(可选)。 |
|
创建此版本的源位置 URL。 |
|
git 提交哈希(如果版本是从 git 源创建)。 |
访问控制要求¶
要显示列表版本,您必须使用对列表具有 USAGE 或 OWNERSHIP 权限的角色。
使用说明¶
LIMIT rows的值不能超过10000。如果省略LIMIT rows,若结果集大于 1 万行,则该命令将导致错误。要查看存在超过 1 万条记录的结果,请在 Snowflake Information Schema 中包含
LIMIT rows或查询相应的视图。
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.
示例¶
显示 MYLISTING 列表的所有版本:
SHOW VERSIONS IN LISTING MYLISTING
+-----------------------------------+------------------------------+------------------------------+-----------------------------------------------+--------------------+--------------------+--------------------+--------------------+---------------------------------------------+---------------------------------------+---------------------------------------+
| created_on | name | alias | location_uri | is_default | is_live | is_first | is_last | comment | source_location_uri | git_commit_hash |
+-----------------------------------+------------------------------+------------------------------+-----------------------------------------------+--------------------+--------------------+--------------------+--------------------+---------------------------------------------+---------------------------------------+---------------------------------------+
| 2025-01-08 11:18:39.921 -0800 | | | snow://listing/MYLISTING/versions/live/ | FALSE | TRUE | FALSE | FALSE | | @listingstage | |
| 2025-01-08 11:18:24.550 -0800 | VERSION$2 | | snow://listing/MYLISTING/versions/version$2/ | TRUE | FALSE | FALSE | TRUE | | @listingstage | |
| 2025-01-08 11:17:32.894 -0800 | VERSION$1 | | snow://listing/MYLISTING/versions/version$1/ | FALSE | FALSE | TRUE | FALSE | | @listingstage | |
+-----------------------------------+------------------------------+------------------------------+-----------------------------------------------+--------------------+--------------------+--------------------+--------------------+---------------------------------------------+---------------------------------------+---------------------------------------+