序列和列:SHOW 命令、视图和 GET_DDL 函数输出的变更¶
在当前 Snowflake 版本中,Snowflake 为序列和表列引入了新的 ORDER 和 NOORDER 参数:
ORDER 指定为序列或自动递增列生成的值按 递增顺序 排列。
NOORDER 指定不保证值按递增顺序排列。
这些新参数出现在命令、函数和视图的输出中。
以下命令和视图的输出包括这个新的有序列:
列名称 |
数据类型 |
描述 |
---|---|---|
|
TEXT |
指定值是否按递增顺序生成。
|
在 SHOW COLUMNS 命令的输出中,autoincrement
列包含 ORDER 或 NOORDER 参数:
- 之前:
如果列的起始值为 1,自动递增 1,则
autoincrement
列包含:start 1 increment 1
- 现在:
如果列设置了 ORDER 参数,则
autoincrement
列包含:start 1 increment 1 order
如果列设置了 NOORDER 参数,则
autoincrement
列包含:start 1 increment 1 noorder
Information Schema 和 Account Usage COLUMNS 视图的输出包括新的 identity_ordered
列:
列名称 |
数据类型 |
描述 |
---|---|---|
|
TEXT |
指定此列是否为标识列,其生成值按递增顺序排列。
|
最后,GET_DDL 函数的输出将包括序列和列的 ORDER 和 NOORDER 参数。
- 现在:
如果列的起始值为 1,自动递增 1,则 GET_DDL 函数的输出不包括 ORDER 或 NOORDER 参数:
create or replace table MYTABLE( MYCOL ... start 1 increment 1 ...
- 待定:
如果列设置了 ORDER 参数,则 GET_DDL 输出包括 ORDER 参数:
create or replace table MYTABLE( MYCOL ... start 1 increment 1 order ...
如果列设置了 NOORDER 参数,则 GET_DDL 输出包括 NOORDER 参数:
create or replace table MYTABLE( MYCOL ... start 1 increment 1 noorder ...
参考号:1225