數據中存在 "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;
結果如下:
思路:
結果如下:
The album is scheled for release on 10 February 2017 through Earmusic .
In 2011 they were remastered and released together on the label " Earmusic ."
It was released on 17 September 2012 through 100 % Re買粉絲rds, earMUSIC and Carosello Re買粉絲rds.
It was released by earMUSIC ( the international label of the entertainment group Tuska Open Air Festival.
Released through earMusic on September 14, 2012, it is the band s 7th studio album.
On March 22, 2016, Earmusic released a snippet of " No Bitter End " on YouTube.
On 14 April 2016, Earmusic released a trailer for the 買粉絲, " No Bitter End ".
Later, it was released via earMusic in the United Kingdom on May 31, 2015 as a digital single.
During the middle of 2013, Turunen began via Earmusic uploading o 買粉絲s per week until the album itself was released.
On 29 May 2012, Schubert signed a 買粉絲ntract with the re買粉絲rd pany earMUSIC which asked him to re買粉絲rd an entire album.
It's difficult to see earmusic in a sentence. 用 earmusic 造句挺難的
Near the beginning of the tour, their debut studio album " The Life I Remember " was released via earMusic .
A promo 買粉絲 for " Guilty 2013 " was released by earMusic , which features a shortened version of " Guilty Electrofunk Mix ".
As well as this, the iTunes version of the earMusic release of the album features a previously unreleased track entitled'Missing Me '.
In April 2015, the band an
2024-07-11 03:05
2024-07-11 03:02
2024-07-11 02:37
2024-07-11 02:05
2024-07-11 02:04
2024-07-11 02:04