浏览代码

1h root 排序公式

zhangbo 1 年之前
父节点
当前提交
b62274432f
共有 1 个文件被更改,包括 8 次插入8 次删除
  1. 8 8
      alg_recsys_rank_item_realtime_1hroot.py

+ 8 - 8
alg_recsys_rank_item_realtime_1hroot.py

@@ -68,13 +68,13 @@ def get_sql(date, previous_date_str, project):
     FROM    (
     SELECT  videoid
     ,dt
-    ,return_all as return
-    ,lastonehour_recommend_view as `view`
-    ,lastonehour_recommend_share as share
-    ,lastonehour_recommend_return1 as return1
-    ,lastonehour_recommend_return2n as return2
-    ,last2nhour_return1 as return3
-    ,last2nhour_return2n as return4
+    ,SUM(return_all) as return
+    ,SUM(lastonehour_recommend_view) as `view`
+    ,SUM(lastonehour_recommend_share) as share
+    ,SUM(lastonehour_recommend_return1) as return1
+    ,SUM(lastonehour_recommend_return2n) as return2
+    ,SUM(last2nhour_return1) as return3
+    ,SUM(last2nhour_return2n) as return4
     FROM    loghubods.video_return_composition_1hour
     WHERE   dt <= '{}23'
     AND     dt >= '{}00'
@@ -164,4 +164,4 @@ if __name__ == '__main__':
 
 
 # cd /root/zhangbo/rov-offline
-# python alg_recsys_rank_item_realtime_1h.py 20240117 20
+# python alg_recsys_rank_item_realtime_1hroot.py 20240408 14