小编Pie*_*and的帖子

Hive:在查询中将数组<string>转换为array <int>

我有两张桌子:

create table a (
`1` array<string>);

create table b (
`1` array<int>);
Run Code Online (Sandbox Code Playgroud)

我想把表格放在表格b中(表格b为空):

insert into table b
select * from a;
Run Code Online (Sandbox Code Playgroud)

这样做时我收到以下错误:

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>.
Run Code Online (Sandbox Code Playgroud)

如果字段只是类型string和字段,我不会得到这个错误int.

有没有办法用数组进行转换?

arrays hadoop hive

6
推荐指数
1
解决办法
5556
查看次数

标签 统计

arrays ×1

hadoop ×1

hive ×1