您现在的位置是:Instagram刷粉絲, Ins買粉絲自助下單平台, Ins買贊網站可微信支付寶付款 >
01 youtube music 買粉絲s 買粉絲untry 2022 episodes youtube(江南style的社會影響)
Instagram刷粉絲, Ins買粉絲自助下單平台, Ins買贊網站可微信支付寶付款2024-06-10 18:41:04【】7人已围观
简介Hive實戰之Youtube數據集本次實戰的數據來自于"YouTube視頻統計與社交網絡"的數據集,是西蒙弗雷澤大學計算機學院在2008年所爬取的數據數據集地址數據之間采用"\t"作為分隔符具體數據如
Hive實戰之Youtube數據集
本次實戰的數據來自于"YouTube視頻統計與社交網絡"的數據集,是西蒙弗雷澤大學計算機學院在2008年所爬取的數據
數據集地址
數據之間采用"\t"作為分隔符
具體數據如下:
數據量大小為1G,條數為500萬+
使用環境為
hive-1.1.0-cdh5.4.5
hadoop-2.6.0-cdh5.4.5
演示形式為使用hive shell
我們一起來看看數據
主要的問題在于category和relatedIDs處理,由于Hive是支持array格式的,所以我們想到的是使用array來存儲category和relatedIDs,但是我們發現category的分割符是"&"而realatedIDs的分隔符是"\t",我們在創建表格的時候能夠指定array的分隔符,但是只能指定一個,所以再將數據導入到Hive表格之前我們需要對數據進行一定轉換和清洗
并且數據中肯定會存在一些不完整數據和一些奇怪的格式,所以數據的清洗是必要的,我在這里所使用的數據清洗方式是使用Spark進行清洗,也可以使用自定義UDF函數來進行清洗
數據清洗注意點
1)我們可以看到每行數據以"\t"作為分隔符,每行有十列數據,最后一列關聯ID可以為空,那么我們對數據進行split之后數組的大小要大于8
2)數據中存在 "uNiKXDA8eyQ KRQE 1035 News & Politics 107" 這樣格式的數據,所以在處理category時需要注意 News & Politics中間的 &
處理后的數據如下:
下面的實戰都是基于數據清洗后的數據進行的
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;
結果如下:
思路:
結果如下:
英語口語之如何練就一口流利英語
英語欄目為您推薦“英語口語之如何練就一口流利英語”,希望能幫助到您!
你想擁有一口流利的英語嗎?Get下面這十大技能,讓你的英語口語飛起來~
1.Find some English radio stations and podcasts in iTunes
在iTunes上找一些英語廣播臺或播客
There are tons of podcasts about all topics imaginable thesedays: entertainment, politics, news. A good way to find one isto look for a podcast from a TV channel you usually watch in your cable TV. Look for one thatinterests you and listen to it in your car while driving. You’ll train your ear that way!
現在有無數的播客提供各類話題:娛樂、政治、新聞。搜尋的最佳方式就是從你經常看的電視頻道找一個出來。挑一個你感興趣的,開車的時候聽一聽。耳朵的本事就這么慢慢鍛煉出來啦。
2.Check out the Top Videos on YouTube and watch for at least a few minutes
在YouTube上找最熱的視頻至少看幾分鐘
Most of them are hilarious! It will be so worth it. Try looking at the 買粉絲ments to pick up somewords and sentences you aren&rsquo
很赞哦!(4)
相关文章
- 03 黃山風景區網紅小火車在哪里(黃山爬山門票多少錢?)
- 02 中國古代對外貿易商品檢驗機制的發展趨勢(漢朝 開通的什么 打通了亞歐之間的通道)
- 02 中國國際貿易單一窗口備案申請怎么填(跨境電商企業在單一窗口備案流程企業怎樣申請進出口貨物收發人)
- 04 10平方米的臥室怎么設計ins風格(什么樣的裝修風格,看著貴氣十足)
- 02 中國國投國際貿易張家港有限公司經營那些(蘇州園區都有那些好廠?)
- 03 黑龍江省對外貿易局(黑龍江省外經貿廳廳長副廳長是誰)
- 03 黑龍江省對外貿易集團有限責任公司(黑龍江海外旅游黑龍江海外旅游有限公司的主管單位在哪里?)
- 03 黃山公交買粉絲下載(國慶七天樂,堵車不快樂!假期旅行如何避免交通擁堵?)
- 02 中國印度貿易額2023一季度(上汽MG印度公司面臨被收購?如何Say NO)
- 02 中國國際經濟貿易仲裁委員會上海分會更名(仲裁管轄問題,合同約定的是中國國際經濟貿易仲裁委員會上海分會,現在是由北京的仲裁還是上海的仲裁)
Instagram刷粉絲, Ins買粉絲自助下單平台, Ins買贊網站可微信支付寶付款的名片
职业:程序员,设计师
现居:广西河池环江毛南族自治县
工作室:小组
Email:[email protected]
热门文章
站长推荐
03 黑龍江紀檢委網站買粉絲買粉絲(中國石油大學(北京) 2020年高校專項計劃招生簡章)
04 2021年上半年外貿工作總結(2021年新聞編輯年終工作總結)
02 中國十大貿易伙伴國(2021年數據)(2021年我國是120多個國家最大的貿易伙伴)
04 2021年上半年對外貿易額(2022上半年外貿進出口展現出較強韌性,這說明了什么?)
02 中國協力能源貿易有限公司(“日本八大商社”是哪八大商社?)
03 黃島原油貿易公司(青島港集團有限公司的公司概況)
04 2018年全國外經貿單證專業培訓考試單證繕制與操作答案(2006年度6月國際商務單證員《繕制與操作》真題含答案)
02 中國國際貿易(我國對外貿易分為哪些方面?)