Hive json 그룹을 나누어 각 값의 두 번째 층을 추출합니다

513 단어 jsonhive
select id,
secondLevel item,
indexValue score
from 
(
select 
id,
split(regexp_replace(regexp_extract(detail,'^\\[(.+)\\]$',1),'\\}]}\\,\\{', '\\}]}\\|\\|\\{'),'\\|\\|') as L1
select * from datatable.table
) as r1
lateral view explode(r1.L1) ss as col
lateral view json_tuple(ss.col,'indexName','secondLevel') rr as indexName,secondLevel
lateral view json_tuple(ss.col,'indexValue') rr as indexValue
where indexName = 'xxxx'

좋은 웹페이지 즐겨찾기