您可以使用函数regexp_replace或regex_extract仅获取产品ID。试试这个:
SELECT * FROM (select user_id, prod_and_ts.product_id as product_id,regex_replace(prod_and_ts.timestamps, "#\d*", "") as timestamps FROM table2 LATERAL VIEWexplode(purchased_item) exploded_table as prod_and_ts) prod_and_ts;



