Hive Struct to String转换(Hive Struct to String conversion)
我有一个包含结构的表 - 让我们说:
create external table table1 (
a int,
b STRUCT ,
e string
)
我在这张桌子上执行选择,得到类似的东西 -
1100 {“c”:12.3,“d”:45.6} str
但是当我将这些数据插入另一个表格时 -
create external table table2 (
a string,
b string,
c string
)
insert overwrite table table2
select a,b,c
from table1;
我得到以下奇怪的行为,表明在hive中struct和string之间的转换不能按预期工作
select * from table2;
会导致 -
1100 12.345.6 str
结果是结构中的一种奇怪的值连接,甚至在处理更复杂的结构时也会发生奇怪的事情
有没有办法阻止这种自动转换? 在这种情况下让hive抛出错误?
有没有一种干净的方法来改变这种自动转换以不同的方式工作?
I have a table that has a struct in it - let's say:
create external table table1 (
a int,
b STRUCT ,
e string