-- 检查样本表中曝光分布
SELECT  dt
        ,COUNT(1) AS total_cnt
        ,SUM(CASE WHEN new_exposure_cnt > 10000 THEN 1 ELSE 0 END) AS exp_gt_10k
        ,SUM(CASE WHEN new_exposure_cnt > 1000 THEN 1 ELSE 0 END) AS exp_gt_1k
        ,SUM(CASE WHEN new_exposure_cnt > 100 THEN 1 ELSE 0 END) AS exp_gt_100
        ,ROUND(AVG(new_exposure_cnt), 0) AS avg_exp
        ,PERCENTILE(CAST(new_exposure_cnt AS BIGINT), 0.9) AS p90_exp
        ,PERCENTILE(CAST(new_exposure_cnt AS BIGINT), 0.99) AS p99_exp
FROM    loghubods.dwd_recsys_alg_sample_all_20250212
WHERE   dt = '${dt}'
AND     apptype = '36'
AND     extend_alg IS NOT NULL
GROUP BY dt
;
