首页 > 代码库 > hive 行转列 并添加虚列

hive 行转列 并添加虚列

select regexp_extract(a.col2,‘(phonenum=\")(.*?)\"‘,2) user_device,
regexp_extract(a.col13,‘(imsicode=\")(.*?)\"‘,2) imsi,
regexp_extract(a.col12,‘(imeicode=\")(.*?)\"‘,2) imei,
call_log from
(select * from ods_sso_dislocation_201408 where day=20140828 and col16="code=\"100\"") a
lateral view explode(split(a.col17,"\\|")) b as call_log;

hive 行转列 并添加虚列