请在 hive 中使用 split
。
首先,我们将使用 705=
作为分隔符来分割数据。
然后再次使用 split 以逗号分隔。这给了我想要的结果。
select split(split('123705=35,4,6752,56','705=')[1],',')[0] col
output
35
,
使用正则表达式:
select regexp_extract(event_list,'705=([0-9.]+)',1)
或者您可以使用带逗号的更严格的正则表达式 ',705=([0-9.]+),'