Hive select data into an array of structs

后端 未结 3 713
暖寄归人
暖寄归人 2020-12-17 04:19

I am trying to figure out a way in Hive to select data from a flat source and output into an array of named struct(s). Here is a example of what I am looking for...

3条回答
  •  醉酒成梦
    2020-12-17 04:57

    You can also use a workaround

    select collect_list(full_name) full_name_list from (
        select 
            concat_ws(',', 
                concat("first_name:",first_name), 
                concat("last_name:",last_name)
                ) full_name, 
            house_id
        from house) a 
    group by house_id
    

提交回复
热议问题