Commit 87259bba authored by yindanlei's avatar yindanlei

add icon_function_day report codes

parent 6270a8a0
...@@ -9,6 +9,7 @@ SET role admin; ...@@ -9,6 +9,7 @@ SET role admin;
ADD JAR hdfs:///user/hive/share/lib/udf/hive-udf-1.0-SNAPSHOT.jar; ADD JAR hdfs:///user/hive/share/lib/udf/hive-udf-1.0-SNAPSHOT.jar;
CREATE TEMPORARY FUNCTION convup AS 'com.gmei.hive.common.udf.UDFConvUpgrade'; CREATE TEMPORARY FUNCTION convup AS 'com.gmei.hive.common.udf.UDFConvUpgrade';
CREATE TEMPORARY FUNCTION setencryption AS 'com.gmei.hive.common.udf.UDFStringSetEncryption';
INSERT OVERWRITE TABLE pm.tl_pm_icon_function_d PARTITION (PARTITION_DAY = ${partition_day}) INSERT OVERWRITE TABLE pm.tl_pm_icon_function_d PARTITION (PARTITION_DAY = ${partition_day})
...@@ -75,10 +76,10 @@ from ...@@ -75,10 +76,10 @@ from
,'TF-toufang5','tf-toufang1','tf-toufang2','tf-toufang3','tf-toufang4','tf-toufang5','benzhan','promotion_aso100' ,'TF-toufang5','tf-toufang1','tf-toufang2','tf-toufang3','tf-toufang4','tf-toufang5','benzhan','promotion_aso100'
,'promotion_qianka','promotion_xiaoyu','promotion_dianru','promotion_malioaso','promotion_malioaso-shequ' ,'promotion_qianka','promotion_xiaoyu','promotion_dianru','promotion_malioaso','promotion_malioaso-shequ'
,'promotion_shike','promotion_julang_jl03','promotion_zuimei','','unknown') then '积分墙' ELSE '医美' END as channel_type ,'promotion_shike','promotion_julang_jl03','promotion_zuimei','','unknown') then '积分墙' ELSE '医美' END as channel_type
,case when (partition_date<='20200916' AND substr(convup(sha1(m.device_id),16,10),-2,2)%20 in(0,1,2,3,4,5,6,7,8,9)) ,case when (partition_date<='20200916' AND substr(convup(setencryption(m.device_id,'sha-1'),16,10),-2,2)%20 in(0,1,2,3,4,5,6,7,8,9))
or (partition_date>='20200917' AND partition_date <='20200922' AND substr(convup(sha1(m.device_id),16,10),-2,2)%20 in(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15)) then '灰度' or (partition_date>='20200917' AND partition_date <='20200922' AND substr(convup(setencryption(m.device_id,'sha-1'),16,10),-2,2)%20 in(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15)) then '灰度'
when (partition_date='20200916' AND substr(convup(sha1(m.device_id),16,10),-2,2)%20 in(10,11,12,13,14,15)) when (partition_date='20200916' AND substr(convup(setencryption(m.device_id,'sha-1'),16,10),-2,2)%20 in(10,11,12,13,14,15))
or (partition_date='20200922' AND substr(convup(sha1(m.device_id),16,10),-2,2)%20 in(16,17,18,19)) then '其他' or (partition_date='20200922' AND substr(convup(setencryption(m.device_id,'sha-1'),16,10),-2,2)%20 in(16,17,18,19)) then '其他'
WHEN partition_date>='20200923' then '灰度全量' else '非灰' end as grey_type WHEN partition_date>='20200923' then '灰度全量' else '非灰' end as grey_type
FROM online.ml_device_day_active_status m FROM online.ml_device_day_active_status m
LEFT JOIN LEFT JOIN
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment