我们可以使用 SQL 查询向 AWS Athena 中的现有表添加列吗?

0

【以下的问题经过翻译处理】 我在 AWS Athena 中有一个表,其中包含 2 条记录。是否可以用SQL 查询将新列插入到表中?

profile picture
ESPECIALISTA
feita há 5 meses15 visualizações
1 Resposta
0

【以下的回答经过翻译处理】 您可以在 Athena 文档中找到有关向表中添加列的更多信息

或者你可以使用 CTAS

例如,您有一张表

CREATE EXTERNAL TABLE sample_test( id string) LOCATION 's3://bucket/path' and you can create another table from sample_test with the query

CREATE TABLE new_test AS SELECT *, 'new' AS new_col FROM sample_test

您可以在 AS 之后使用任何可用的查询

profile picture
ESPECIALISTA
respondido há 5 meses

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas