在将行作为其中之一作为数组的配置单元表中插入行时出现错误10293 [英] Getting Error 10293 while inserting a row to a hive table having array as one of the fileds

查看:96
本文介绍了在将行作为其中之一作为数组的配置单元表中插入行时出现错误10293的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have a hive table created using the following query:

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

如何解决此问题?

推荐答案

以某种奇怪的方式在复杂数据类型中输入值的语法,但这是我个人的看法.

The syantax to enter values in complex datatype if kinda bit weird, however this is my personal opinion.

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

You need a dummy table to insert values into hive table with complex datatype.

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]

这篇关于在将行作为其中之一作为数组的配置单元表中插入行时出现错误10293的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆