Hive之例题

1.统计视频观看数Top10
select
    videoId,
    rank()over(order by views desc)
from gulivideo_orc
limit 10
+--------------+----------------+
|   videoid    | rank_window_0  |
+--------------+----------------+
| dMH0bHeiRNg  | 1              |
| 0XxI-hvPRRA  | 2              |
| 1dmVU08zVpA  | 3              |
| RB-wUgnyGv0  | 4              |
| QjA5faZF1A8  | 5              |
| -_CSo1gOd48  | 6              |
| 49IDp76kjPw  | 7              |
| tYnn51C3X_w  | 8              |
| pv5zWaTEVkI  | 9              |
| D2kJZOfq7zk  | 10             |
+--------------+----------------+
2.统计视频类别热度Top10(类别热度:类别下的总视频数)
select
    videoId,
    category,    
    category_name
from gulivideo_orc
lateral view explode(category) gulivideo_orc_tmp as category_name
+--------------+-----------------------+----------------+
|   videoid    |       category        | category_name  |
+--------------+--------
上一篇:【故障处理】ERROR 1872 (HY000): Slave failed to initialize relay log info structure from the repository


下一篇:Flutter Error: The method ‘toInt‘ isn‘t defined for the class ‘Decimal‘