| INSERT OVERWRITE TABLE internal_platform_db.ads_qq_sq_frd_recommendation_result_list_df_query_engine_138 PARTITION (imp_date = 20260608) |
| WITH feature_modified_v2 AS ( |
| SELECT |
| uin |
| , touin |
| , COALESCE(c2c_score, 0) AS c2c_score |
| , COALESCE(LOG(1 + c2c_cnt_score), 0) AS log_c2c_cnt_score |
| , COALESCE(socialzone_visit_score, 0) AS socialzone_visit_score |
| , COALESCE(socialzone_like_score, 0) AS socialzone_like_score |
| , COALESCE(socialzone_comment_score, 0) AS socialzone_comment_score |
| , COALESCE(profile_view_score, 0) AS profile_view_score |
| , COALESCE(profile_like_score, 0) AS profile_like_score |
| , COALESCE(touser_id_active_layer, 0) AS touser_id_active_layer |
| , COALESCE(LOG(100 - age_diff), 0) AS log_age_diff_complement |
| , COALESCE(LOG(1 + common_frd_num), 0) AS log_common_frd |
| , COALESCE(active_layer_score, 0) AS active_layer_score |
| , COALESCE(LOG(1 + frd_tag_num), 0) AS log_frd_tag_num |
| , COALESCE(is_same_city, 0) AS is_same_city |
| , COALESCE(is_focus_frd, 0) AS is_focus_frd |
| , COALESCE(comsg_score, 0) AS comsg_score |
| FROM |
| internal_platform_db.dwd_relationship_strength_features_v4_di_query_engine_138 |
| WHERE |
| imp_date = 20260608 |
| ), |
| weighted_score_v2 AS ( |
| SELECT |
| fm.uin |
| , fm.touin |
| , (0.0327 * fm.log_frd_tag_num + |
| 0.0386 * fm.touser_id_active_layer + |
| 0.0853 * (1 - fm.is_same_city) + |
| 0.0564 * fm.c2c_score + |
| 0.1895 * fm.log_c2c_cnt_score + |
| 0.2455 * fm.socialzone_visit_score + |
| 0.1055 * fm.socialzone_like_score + |
| 0.1514 * fm.socialzone_comment_score + |
| 0.1556 * fm.profile_view_score + |
| 0.1531 * fm.profile_like_score) / 28 AS score |
| FROM |
| feature_modified_v2 fm |
| ) |
| SELECT |
| ws.uin |
| , ws.touin |
| , 1 + (ROUND(ws.score, 4) * 10000) AS score |
| , ROUND(ws.score, 4) AS raw_score |
| FROM |
| weighted_score_v2 ws |
| WHERE |
| uin >= 10000 |
| AND touin >= 10000 |