如何修改STRUCT类型列?

问题描述 投票:0回答:1

有一个名为 newtest 的表,列名称为 source,类型为

struct<name:string, size:bigint>.

我想更新/修改这个结构类型为

struct<name:string, size:bigint, index:bigint>

如何更改/修改上面提到的source列。

尝试使用下面的sql查询它不起作用:

ALTER TABLE newtest MODIFY COLUMN source STRUCT<name: STRING, size: bigint, index:bigint>
pyspark struct bigdata alter-table
1个回答
0
投票
ALTER TABLE newtest ADD COLUMNS (source.index bigint AFTER size)
© www.soinside.com 2019 - 2024. All rights reserved.