英文:
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
并更改了 SORTKEYS
为 SORTKEY
。问题已解决。
英文:
I removed ENCODE AUTO
and amended SORTKEYS
to SORTKEY
. It fixed the problem.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论