当前位置:   article > 正文

maxCompute odps 行转列

maxcompute odps行转列函数

 

select
     name
    ,REGEXP_REPLACE(str,"[\\[\"\\]]",'')
from (
    select
        trans_array(1, ",", name,list) as (name,str)
    from (
    select '经办人' as name,'["1001","1002"]' as list
    ) t1
) t2
;

 

select 
    trans_array(1, ",", name,REGEXP_REPLACE(list,"[\\[\"\\]]",'')) as (name,str)
from (
select '经办人' as name,'["1001","1002"]' as list
) t1
;

 

select
     name
    ,list_tmp
from (
    select '经办人' as name,'["1001","1002"]' as list
) t1
lateral view explode(split(REGEXP_REPLACE(list,"[\\[\"\\]]",''),',')) b AS list_tmp
;

 

转载于:https://www.cnblogs.com/chenzechao/p/10948596.html

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/725879
推荐阅读
相关标签
  

闽ICP备14008679号