您现在的位置是:Instagram刷粉絲, Ins買粉絲自助下單平台, Ins買贊網站可微信支付寶付款 >
02 youtube官網中文視頻數據集怎么(Hive實戰之Youtube數據集)
Instagram刷粉絲, Ins買粉絲自助下單平台, Ins買贊網站可微信支付寶付款2024-05-30 06:37:15【】8人已围观
简介下面的實戰都是基于數據清洗后的數據進行的1)youtube1的創建,文件格式為textfilecreatetableyoutube1(買粉絲Idstring,uploaderstring,ageint
1)youtube1的創建,文件格式為textfile
create table youtube1(買粉絲Id string, uploader string, age int, category array<string>, length int, views int, rate float, ratings int, 買粉絲ments int,relatedId array<string>)
row format delimited
fields terminated by "\t"
買粉絲llection items terminated by "&"
stored as textfile;
2)youtube2的創建,文件格式為orc
create table youtube2(買粉絲Id string, uploader string, age int, category array<string>, length int, views int, rate float, ratings int, 買粉絲ments int,relatedId array<string>)
row format delimited
fields terminated by "\t"
買粉絲llection items terminated by "&"
stored as orc;
3)youtube3的創建,文件格式為orc,進行桶分區
create table youtube3(買粉絲Id string, uploader string, age int, category array<string>, length int, views int, rate float, ratings int, 買粉絲ments int,relatedId array<string>)
clustered by (uploader) into 8 buckets
row format delimited
fields terminated by "\t"
買粉絲llection items terminated by "&"
stored as orc;
數據導入:
1)load data inpath "path" into table youtube1;
2)由于無法將textfile格式的數據導入到orc格式的表格,所以數據需要從youtube1導入到youtube2和youtube3:
insert into table youtube2 select * from youtube1;
insert into table youtube3 select * from youtube1;
1)user_tmp的創建,文件格式textfile,24buckets
create table user_tmp(uploader string,買粉絲s int,friends int)
clustered by (uploader) into 24 buckets
row format delimited
fields terminated by "\t"
stored as textfile;
2)user的創建,文件格式orc,24buckets
create table user(uploader string,買粉絲s int,friends int)
clustered by (uploader) into 24 buckets
row format delimited
fields terminated by "\t"
stored as orc;
user表的數據導入也是同理
數據導入:
1)load data inpath "path" into table user_tmp;
2)由于無法將textfile格式的數據導入到orc格式的表格,所以數據需要從user_tmp導入到user:
insert into table user select * from user_tmp;
1)統計出觀看數最多的10個視頻
2)統計出視頻類別熱度的前10個類型
3)統計出視頻觀看數最高的50個視頻的所屬類別
4)統計出觀看數最多的前N個視頻所關聯的視頻的所屬類別排行
5)篩選出每個類別中熱度最高的前10個視頻
6)篩選出每個類別中評分最高的前10個視頻
7)找出用戶中上傳視頻最多的10個用戶的所有視頻
8)篩選出每個類別中觀看數Top10
select * from youtube3 order by views desc limit 10;
結果如下:
select tagId, 買粉絲unt(a.買粉絲id) as sum from (select 買粉絲id,tagId from youtube3 lateral view explode(category) catetory as tagId) a group by a.tagId order by sum desc limit 10;
結果:
select tagId, 買粉絲unt(a.買粉絲id) as sum from (select 買粉絲id,tagId from (select * from youtube3 order by views desc limit 20) e lateral view explode(category) catetory as tagId) a group by a.tagId order by sum desc;
結果:
思路:
結果:
思路:
結果如下:
select * from youtube_category where categoryId="Music" order by ratings desc limit 10;
結果如下:
思路:
結果如下:
很赞哦!(791)
热门文章
站长推荐
04 廣州嘉鑫國際貿易有限公司(全球富人榜,亞洲富人榜,中國富人榜分別是誰,資金有多少?)
04 廣東省中科進出口貿易有限公司銀行(常識性騙局)
01 網紅圖片女生頭像小學生版(各位有誰看過抖音上的那個叫什么七鶴大人的那個真的有這么帥嗎,有誰發給我圖片看一下到底長啥樣)
04 廣外外語外貿大學本科有會計專業招文科生(廣州大學和廣東外語外貿大學2013各專業錄取分數線(文科) 廣州大學和廣外適合文科生比較好的專業有)
01 網紅卡通圖片女生頭像(2021年最火的頭像女動漫,求一些女生的頭像,最好是動漫的,而且背景要)
04 廣州南黎貿易有限公司招聘(哈工大計算機研究生就業怎么樣?是大部分都在東北就業么,有多少去北京,天津的,進什么公司?就業和北航)
04 廣東風馳貿易有限公司(國際著名汽車輪胎品牌?)
01 網紅賣的衣服從哪進貨(想知道那些網紅衣服的貨源都是怎么找的,或者是在哪里進的貨?我想開一個網店)