11.4.6 统计每个类别中视频流量Top10

和上个需求基本一样,只是排序方式变成了流量而已(ratings)

select
    *
from(
    select
        videoId,
        ratings,
        category_name,
        rank() over(partition by category_name order by ratings desc) rank
    from(
        select
            ratings,
            videoId,
            category_name
        from gulivideo_orc
        lateral view explode(category) tmp as category_name   
    ) t1
) t2
where rank <= 10;
Copyright © 尚硅谷大数据 2019 all right reserved,powered by Gitbook
该文件最后修订时间: 2018-11-20 18:14:21

results matching ""

    No results matching ""