Can we add column to an existing table in AWS Athena using SQL query?

0

I have a table in AWS Athena which contains 2 records. Is there a SQL query using which a new column can be inserted in to the table?

已提問 5 年前檢視次數 2162 次
1 個回答
0
已接受的答案

You can find more information about adding columns to table in Athena documentation

Or you can use CTAS

For example, you have a table with

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
You can use any available query after AS

已回答 5 年前
profile picture
專家
已審閱 1 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南