gpt4 book ai didi

hive - 将行插入到具有数组作为字段之一的配置单元表时出现错误 10293

转载 作者:行者123 更新时间:2023-12-04 02:57:18 28 4
gpt4 key购买 nike

我有一个使用以下查询创建的配置单元表:

create table arraytbl (id string, model string, cost int, colors array <string>,size array <float>)
row format delimited fields terminated by ',' collection items terminated by '#';

现在,在尝试插入一行时:
insert into mobilephones values 
("AA","AAA",5600,colors("red","blue","green"),size(5.6,4.3));

我收到以下错误:
FAILED: SemanticException [Error 10293]: Unable to create temp file for insert values Expression of type TOK_FUNCTION not supported in insert/values

我该如何解决这个问题?

最佳答案

在复杂数据类型中输入值的语法有点奇怪,但这是我个人的意见。

您需要一个虚拟表来将值插入具有复杂数据类型的配置单元表中。

insert into arraytbl select "AA","AAA",5600, array("red","blue","green"), array(CAST(5.6 AS FLOAT),CAST(4.3 AS FLOAT)) from (select 'a') x;

这就是插入后的样子。
hive> select * from arraytbl;
OK
AA AAA 5600 ["red","blue","green"] [5.6,4.3]

关于hive - 将行插入到具有数组作为字段之一的配置单元表时出现错误 10293,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52330141/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com