我有table
create table regs(id string,regs string)
create table regs(
id string,
regs string)
数据示例
id regs1 23:7:97.27%, 77:1:0.56%, 09:1:0.48%2 01:3:1.26%, 15:1:0.09%3 26:1:0.17%
id regs
1 23:7:97.27%, 77:1:0.56%, 09:1:0.48%
2 01:3:1.26%, 15:1:0.09%
3 26:1:0.17%
我怎样才能得到这个结果?
id regs1 23:7:97.27%1 77:1:0.56%1 09:1:0.48%2 01:3:1.26% 2 15:1:0.09%3 26:1:0.17%
1 23:7:97.27%
1 77:1:0.56%
1 09:1:0.48%
2 01:3:1.26%
2 15:1:0.09%
ijxebb2r1#
使用此模式拆分regs ', *' -表示逗号+任意数量的空格,并分解:
', *'
select r.id, e.regfrom regs r lateral view explode(split(r.regs, ', *')) e as reg
select r.id, e.reg
from regs r
lateral view explode(split(r.regs, ', *')) e as reg
1条答案
按热度按时间ijxebb2r1#
使用此模式拆分regs
', *'
-表示逗号+任意数量的空格,并分解: