例如,查询具有值:
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(查询,"&"," =")[" productid")将映射到hive productid的数字。但是现在在Presto中,该功能似乎无效。那么如何从查询中检索它?我认为查询并不严格。
split_to_map(query,'&','=')['productId']
https://prestodb.io/docs/current/functions/string.htmlhttps://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