无法指定排序键或分发键。

huangapple go评论45阅读模式
英文:

Can specify neither the sort key nor the distribution key

问题

以下是翻译好的部分:

"CREATE TABLE IF NOT EXISTS dev.sch.tbl (
date DATE NOT NULL,
cid VARCHAR(32) NOT NULL,
cc VARCHAR(8) NOT NULL
)
ENCODE AUTO
DISTKEY ( cid )
SORTKEYS ( date, cc )
;"

"ERROR: syntax error at or near "DISTSTYLE" Position: 267 [ErrorId: 1-6477b934-7ee598ef14c5f3604df79394]"

英文:

What is wrong with my syntax? I cannot make a table and specify the sort keys and distribution column. I am the owner of the RedShift database. If I remove the SORTKEY and DISTKEY definition the statement works.

CREATE TABLE IF NOT EXISTS dev.sch.tbl (
    date DATE NOT NULL,
    cid VARCHAR(32) NOT NULL,
    cc VARCHAR(8) NOT NULL
)
ENCODE AUTO
DISTKEY ( cid )
SORTKEYS ( date, cc )
;

> ERROR: syntax error at or near "DISTSTYLE" Position: 267 [ErrorId:
> 1-6477b934-7ee598ef14c5f3604df79394]

答案1

得分: 1

我删除了 ENCODE AUTO 并更改了 SORTKEYSSORTKEY。问题已解决。

英文:

I removed ENCODE AUTO and amended SORTKEYS to SORTKEY. It fixed the problem.

huangapple
  • 本文由 发表于 2023年6月1日 05:21:19
  • 转载请务必保留本文链接:https://go.coder-hub.com/76377386.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定