我有两个表:
create table a (
`1` array<string>);
create table b (
`1` array<int>);
我想将表格a放入表格b中(表格b为空):
insert into table b
select * from a;
当我这样做时,我会收到以下错误提示:
FAILED: SemanticException [Error 10044]: Line 1:18 Cannot insert into
target table because column number/types are different 'b': Cannot
convert column 0 from array<string> to array<int>.
如果字段只是 string
和 int
类型,我就不会遇到这个错误。
有没有一种方法可以对数组进行强制转换?
来自 table lateral view outer explode(string_array) a as array_element
)s 按 col1、col2 分组 ;``` 解决我的问题 - dolphinZhang