Commit f5c07267 authored by litaolemo's avatar litaolemo

update

parent e52a06e0
...@@ -81,8 +81,8 @@ spark.sql("CREATE TEMPORARY FUNCTION is_json AS 'com.gmei.hive.common.udf.UDFJso ...@@ -81,8 +81,8 @@ spark.sql("CREATE TEMPORARY FUNCTION is_json AS 'com.gmei.hive.common.udf.UDFJso
spark.sql("CREATE TEMPORARY FUNCTION arrayMerge AS 'com.gmei.hive.common.udf.UDFArryMerge'") spark.sql("CREATE TEMPORARY FUNCTION arrayMerge AS 'com.gmei.hive.common.udf.UDFArryMerge'")
task_days = 120 task_days = 3
for t in range(5, task_days): for t in range(0, task_days):
day_num = 0 - t day_num = 0 - t
now = (datetime.datetime.now() + datetime.timedelta(days=day_num)) now = (datetime.datetime.now() + datetime.timedelta(days=day_num))
last_30_day_str = (now + datetime.timedelta(days=-30)).strftime("%Y%m%d") last_30_day_str = (now + datetime.timedelta(days=-30)).strftime("%Y%m%d")
......
...@@ -95,11 +95,8 @@ spark.sql("CREATE TEMPORARY FUNCTION arrayMerge AS 'com.gmei.hive.common.udf.UDF ...@@ -95,11 +95,8 @@ spark.sql("CREATE TEMPORARY FUNCTION arrayMerge AS 'com.gmei.hive.common.udf.UDF
sql_search_ctr = r""" sql_search_ctr = r"""
select count(1) from ( select count(1) from (
SELECT partition_date, SELECT partition_date,
cl_id, cl_id,
v.recommend_type,
count(card_id) as session_pv0, count(card_id) as session_pv0,
count(distinct app_session_id) as session_pv
FROM FROM
( (
SELECT partition_date, SELECT partition_date,
......
...@@ -470,6 +470,7 @@ CREATE TABLE recommend_strategy_d_fix( ...@@ -470,6 +470,7 @@ CREATE TABLE recommend_strategy_d_fix(
recommend_ctr FLOAT, recommend_ctr FLOAT,
second_jump_ctr FLOAT, second_jump_ctr FLOAT,
click_ctr FLOAT, click_ctr FLOAT,
page_pv_20_percent FLOAT,
pid varchar(100), pid varchar(100),
PRIMARY KEY ( pid ) PRIMARY KEY ( pid )
...@@ -478,5 +479,5 @@ CREATE TABLE recommend_strategy_d_fix( ...@@ -478,5 +479,5 @@ CREATE TABLE recommend_strategy_d_fix(
alert alert
ALTER TABLE recommend_strategy_d ADD recommend_ctr FLOAT; ALTER TABLE recommend_strategy_d ADD recommend_ctr FLOAT;
ALTER TABLE recommend_strategy_d ADD second_jump_ctr FLOAT; ALTER TABLE recommend_strategy_d ADD second_jump_ctr FLOAT;
ALTER TABLE recommend_strategy_d ADD click_ctr FLOAT; ALTER TABLE recommend_strategy_d_fix ADD page_pv_20_percent FLOAT;
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