select view_date,
client_page_id,
CASE WHEN (SUBSTRING(Client_Page_ID,1,8) = 'PRODUCT:'
OR SUBSTRING(Client_Page_ID,1,15) = 'MOBILE:PRODUCT:'
OR SUBSTRING(Client_Page_ID,1,16) = 'MOBILE2:PRODUCT:'
OR SUBSTRING(Client_Page_ID,1,16) = 'IPPRODUCTDETAIL:'
OR SUBSTRING(Client_Page_ID,1,16) = 'ADPRODUCTDETAIL:')
AND SPLIT(REVERSE(Client_Page_Id),'\\\(')[0] IS NOT NULL
THEN REVERSE(SPLIT(SPLIT(REVERSE(Client_Page_Id),'\\\(')[0],'\\\)')[1])
ELSE ''
END AS Client_Product_id
FROM PageView A
--where Client_Page_ID like '%PRODUCT%';
如上所示 ,我加了where条件后 就不会报错,但是不加就立马出问题了 。。。请教高手帮忙!!
Hive
SQL
|
|