在 Impala 中添加一个新列以更新复杂类型

add a new column in Impala to update complex type

我有一个 table,它的模式中有复杂类型,例如:

address   ARRAY<STRUCT<street:STRING, state:STRING, names:ARRAY<STRING>, zip:INT>>

不知道怎么改成

address   ARRAY<STRUCT<street:STRING, city:STRING, state:STRING, names:ARRAY<STRING>, zip:INT>>

使用更改查询?

我们可以使用 ALTER 和 CHANGE:

ALTER table name_of_table CHANGE address address ARRAY<STRUCT<street:STRING, city:STRING, state:STRING, names:ARRAY<STRING>, zip:INT>>