如何从 presto 查询中获取数字?

How to get the numbers from query in presto?

例如,查询的值为:

currentView=/review_list_renewal_page&page=SDP&vendorItemID=3081429363&categoryID=&itemID=52159373&eventReferrer=/click_top_button&itemProductID=&pdpStyle=BRAND_SDP_FASHION&content=option_picker&type=brandSDPFashion&q=&logCategory=event&logType=click&productID=12257000&optionStatus=normal&searchId=&memberID=6339421&rank=&request_time=1487114662328&tz=+0900&appVersion=4.5.2&wl_mo=LG-F460S&wl_ma=LGE&wl_sn=Android&wl_v=5.0.1&wl_r=1440x2392&wl_l=ko&wl_c=KR

我使用 STR_TO_MAP(query, "&", "=")["productId"] 获取映射到 Hive 中的 productId 的数字。但现在转眼间,这个功能似乎无效了。那么如何从查询中检索它呢? 我认为查询的格式不严格。

split_to_map(query,'&','=')['productId'] 

https://prestodb.io/docs/current/functions/string.html https://prestodb.io/docs/current/functions/map.html

演示

presto> select split_to_map('currentView=/review_list_renewal_page&page=SDP&vendorItemID=3081429363&categoryID=&itemID=52159373&eventReferrer=/click_top_button&itemProductID=&pdpStyle=BRAND_SDP_FASHION&content=option_picker&type=brandSDPFashion&q=&logCategory=event&logType=click&productID=12257000&optionStatus=normal&searchId=&memberID=6339421&rank=&request_time=1487114662328&tz=+0900&appVersion=4.5.2&wl_mo=LG-F460S&wl_ma=LGE&wl_sn=Android&wl_v=5.0.1&wl_r=1440x2392&wl_l=ko&wl_c=KR^J','&','=')['productID'];
  _col0
----------
 12257000