简体   繁体   English

Redshift Spectrum 是否允许您在外部表上添加列

[英]Does Redshift Spectrum allow you to add columns on an external table

I cant find anything in the Redshift Documentation on Altering an external table.我在关于改变外部表的 Redshift 文档中找不到任何内容。 Just notes on adding a partition.只是关于添加分区的注意事项。

I would need to do something like this我需要做这样的事情

Alter table spectrum.some_table
Add column notes character varying;

Does anyone have experience with this before I potentially embarrass myself with a PR?在我用 PR 可能让自己难堪之前,有没有人有这方面的经验?

Many thanks非常感谢

No. 'Alter table XXX add column ...' is only valid for an internal table.不可以。“Alter table XXX add column ...”仅对内部表有效。 Since Spectrum is based on files stored in S3 these files would also need to change their contents to support the new table definition.由于 Spectrum 基于存储在 S3 中的文件,因此这些文件也需要更改其内容以支持新的表定义。 The external table definition and the construction of the files are linked so it is not clear as to why you would want to add a column to an external table other than saving on statements (alter vs drop & create).外部表定义和文件的构造是链接的,因此不清楚为什么要向外部表添加列而不是保存语句(alter vs drop & create)。 The may be a way to achieve your greater objective (that I don't see) if you state what that is.如果您说明那是什么,这可能是实现您更大目标(我看不到)的一种方式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM