您现在的位置是:Instagram刷粉絲, Ins買粉絲自助下單平台, Ins買贊網站可微信支付寶付款 >
02 youtube官網中文視頻數據集怎么(Hive實戰之Youtube數據集)
Instagram刷粉絲, Ins買粉絲自助下單平台, Ins買贊網站可微信支付寶付款2024-07-19 13:00:35【】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;
結果如下:
思路:
結果如下:
很赞哦!(46157)
相关文章
- 油煙機排煙管裝飾罩安裝視頻(怎樣安裝吸油煙機裝飾罩 吸油煙機裝飾罩安裝方法介紹【詳解】)
- 油煙機排風管安裝(抽油煙機的排風管掉下來了,怎么裝上去啊?)
- 油煙機排煙管高度尺寸(家用抽油煙機排煙管直徑一般是多少)
- 油煙機排煙管裝飾罩拆卸圖解(油煙機裝飾罩如何安裝)
- 油煙機煙管多少錢一根(青島清洗油煙機換管多少錢)
- 03 youtube官網網頁版下載不到桌面了(you tu be的官網是多少?)
- 03 youtube官網網頁版下載官網免費下載課件(電腦上錄游戲視頻用哪個軟件好?)
- 03 youtube官網網頁版下載安裝教程windows菜(初學者怎么學習Python)
- 油煙機排煙管過長怎么辦(抽油煙機管道長怎么辦)
- 03 youtube官網網頁版下載官方正版電腦版(ios app上架流程是什么,怎樣避免提交審核被拒)
热门文章
站长推荐
油煙機煙管安裝視頻教學(油煙機煙管怎么安裝)
油煙機排風管180轉160影響大嗎(家里預留通風管是100的吸油煙機排風管150的影響排煙效果嗎?)
油煙機煙管多久更換(煙機的鋁箔管多久更換?)
03 youtube官網網頁版下載不用客戶賬號(什么信用卡可以綁定任天堂)
03 youtube官網網頁版下載官方正版入口網頁(ios app上架流程是什么,怎樣避免提交審核被拒)
03 youtube官網網頁版下載官方下載正版(you tu be的官網是多少?)
03 youtube官網網頁版下載官網免費下載官網(迅雷、百度云速度太慢?這 6 個超好用的下載工具你一定要知道)
03 youtube官網網頁版下載安裝官網apple watch(App Store上有哪些冷門但逆天的 App?)