with base as
(
select reflect('java.net.URLDecoder', 'decode', '/trip_flutter?flutterName=flutter_bus_list&fromCity=上海&fromCityId=&fromStation=&toCity=如皋&toCityId=&toStation=&fromDate=2022-10-11&busMixType=1&utmSource=pltUtm_bus&tab=bus&&userFromContAtrr=&userToContAtrr=&searchType=1' , 'UTF-8') as a
)
-- 第二个位置上的参数可以传入:HOST, PATH, QUERY, REF, PROTOCOL, AUTHORITY, FILE, and USERINFO来获取url的不同部分
select parse_url(concat('http://',a), 'QUERY','fromCity')
from base
bolg:【hive】从url中提取需要的部分字符串 - 灰信网(软件开发博客聚合)
贡献者:宋朝阳