我最近开始学习蜂巢。我有一个python列表,其中包含以下值
list=['hello:struct', 'env:string', 'element:struct','AppId:string','processId:string']
因此,使用上面的值我需要创建一个hive DDL。与此类似。
create table demo
{
hello :struct
<
env:string,
element:struct
<
AppId:string,
processId:string
>
>
formatted b\y..
location..
答案 0 :(得分:0)
我建议你使用JSON serde。见https://community.hortonworks.com/repos/30883/hive-json-serde.html
你所追求的DDL
CREATE TABLE demo
(
hello struct
<
env:string,
element:struct
<
AppId:string,
processId:string
>
>
)
ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe'
LOCATION '/user/hive/demo';