最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

auto increment - Can't Create Hybrid Table in Snowflake - Stack Overflow

programmeradmin1浏览0评论

I'm trying to create a hybrid table in Snowflake using the following syntax:

CREATE HYBRID TABLE FOO 
(
    ID NUMBER(10,0) PRIMARY KEY NOT NULL AUTOINCREMENT START 1 INCREMENT 1,
    NAME VARCHAR(8) NULL
);

This produces an error

[0A000][391411] This feature is not supported for hybrid tables: 'TRANSIENT_DATA'

Chat GPT o3-mini-high speculates that auto-incrementing columns require transient data structures under the hood, and that I need to use sequences or application logic to achieve this effect; however, that seems overly complicated, and the syntax I'm using is taken straight from Snowflake's own documentation.

Can anyone refute the AI here and come up with a better solution?

I'm trying to create a hybrid table in Snowflake using the following syntax:

CREATE HYBRID TABLE FOO 
(
    ID NUMBER(10,0) PRIMARY KEY NOT NULL AUTOINCREMENT START 1 INCREMENT 1,
    NAME VARCHAR(8) NULL
);

This produces an error

[0A000][391411] This feature is not supported for hybrid tables: 'TRANSIENT_DATA'

Chat GPT o3-mini-high speculates that auto-incrementing columns require transient data structures under the hood, and that I need to use sequences or application logic to achieve this effect; however, that seems overly complicated, and the syntax I'm using is taken straight from Snowflake's own documentation.

Can anyone refute the AI here and come up with a better solution?

Share Improve this question edited Mar 20 at 5:03 marc_s 756k184 gold badges1.4k silver badges1.5k bronze badges asked Mar 19 at 19:51 user29992109user29992109 32 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 0

You try to create a Hybrid table on a transient database. A transient databases do not have a Fail-safe period so they do not incur additional storage costs once they leave Time Travel; however, this means they are also not protected by Fail-safe in the event of a data loss.

https://docs.snowflake/en/sql-reference/sql/create-database#optional-parameters

Snowflake Hybrid tables do not support transient databases. You need to create (and use) a permanent database.

running your sql worked for me:

CREATE HYBRID TABLE FOO (
    ID NUMBER(10,0) PRIMARY KEY NOT NULL AUTOINCREMENT START 1 INCREMENT 1,
    NAME VARCHAR(8) NULL
);
status
Table FOO successfully created.

I tried in a clean worksheet with the use database X; not set, and got the expected error message of:

Cannot perform CREATE TABLE. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.

So I suspect you are doing something you have not describe. I was using role SYSADMIN

发布评论

评论列表(0)

  1. 暂无评论