資料儲存字段格式如下(json-最終展示結果:array互相巢狀):
string='
,"adcode":"310106","province":"上海市","city":"上海市","district":"靜安區","fromsearch":1,"range":true,"name":"猛獁電動(共和新路***)","tag":false,"price":false,"description":"上海市靜安區共和新路492號","area_id":"310106","business_name":"猛獁電動(共和新路***)","latitude":31.251923,"longitude":121.463251,"poi_name":"上海市 · 猛獁電動(共和新路***)","poi_id":"9088848902695992720","level":1,"selected":true,"rangedistance":"2.0","citycode":"310000","extra_items":[,"adcode":"310106","province":"上海市","city":"上海市","district":"靜安區","fromsearch":1,"range":true,"name":"猛獁電動(共和新路***)","tag":false,"price":false,"description":"上海市靜安區共和新路492號","area_id":"310106","business_name":"猛獁電動(共和新路***)","latitude":31.251923,"longitude":121.463251,"poi_name":"上海市 · 猛獁電動(共和新路***)","poi_id":"9088848902695992720","level":1,"selected":true,"rangedistance":"2.0","citycode":"310000"},,"adcode":"310104","province":"上海市","city":"上海市","district":"徐匯區","fromsearch":1,"range":true,"name":"猛獁電動(中山南二路***)","tag":false,"price":false,"description":"上海市徐匯區中山南二路861號","area_id":"310104","business_name":"猛獁電動(中山南二路***)","latitude":31.184747,"longitude":121.450555,"poi_name":"上海市 · 猛獁電動(中山南二路***)","poi_id":"1737914136852040362","level":1,"selected":true,"rangedistance":"2.0","citycode":"310000"},,"adcode":"310113","province":"上海市","city":"上海市","district":"寶山區","fromsearch":1,"range":true,"name":"猛獁電動專賣店(共江路店)","tag":false,"price":false,"description":"上海市寶山區共江路204號","area_id":"310113","business_name":"猛獁電動專賣店(共江路店)","latitude":31.331,"longitude":121.456731,"poi_name":"上海市 · 猛獁電動專賣店(共江路店)","poi_id":"2079399087608466027","level":1,"selected":true,"rangedistance":"2.0","citycode":"310000"}]}
'select
poi_name_now
,get_json_object(m,
'$.poi_name
') as
poi_name
from
(
select get_json_object(string, '
$.poi_name
') as poi_name_now --
當前門店
,get_json_object(string, '
$.extra_items
') as extra_it --
所有門店
from
table
)lateral
view explode(split(regexp_replace(extra_it,'
^\\[|]$
',''), '
,(?!")
')) ext_it as
mgroup
by poi_name_now,get_json_object(m, '
$.poi_name
')
hive複雜資料型別 a29
一 map struct array 這3種的用法 1 array的使用 建立資料庫表,以array作為資料型別 create table person name string,work locations array row format delimited fields terminated b...
Hive複雜資料型別之array
create table tablename colname array 基本型別 說明 下標從0開始,越界不報錯,以null代替測試資料 zhangsan 78,89 92,96 lisi 67,75 83,94 王五 23 12create table ifnot exists arr1 nam...
post 傳遞陣列等複雜資料
之前總結了一篇關於ajax使用.a jax傳 遞陣列的 部落格,但 是每次使 用 aj ax傳遞 陣列的博 客,但是 每次使用 ajax都需要配置url datatype contenttype等,太過麻煩,於是想嘗試使用 post方法進行傳值,最近正好在專案中需要使用,做一下筆記 一 簡單型別的l...