文档介绍:大数据分析项目
公司简介:
智友是一个年轻的文化品牌,旗下有多个互联网产品线,覆盖生活方式、音乐、创意,时尚等多个领域。
致力发展为最大的年轻人文化出版与发行渠道,挖掘文化领域的年轻力量。旗下产品音乐软件“xxx”是时下最流行c":"我是不是该安静的走开,真的爱你,灰色轨迹"}
{"imei":"864874020839761","phone type":"huawei p6","phone system":"","user_name":"bigbaby","like_music":"Laser life,简单爱,演员,最冷的一天"}
{"imei":"864874020839762","phone type":"huawei p6","phone system":"","user_name":"1993058","like_music":"最好的我,北国,少年游"}
{"imei":"864874020839764","phone type":"huawei p6","phone system":"","user_name":"小于一","like_music":"imagine,respect,hey jude"}
{"imei":"864874020839765","phone type":"huawei p6","phone system":"","user_name":"the who","like_music":"misty,your eyes,all i want"}
用spark清洗:
Var meidian=("hdfs://jun110:9000/user/spark/")
Var qingxi=(”user_name”,”like_music”)
("hdfs://jun110:9000/user/spark/qingxi","json")
json转化成CSV格式的文件:
周一懵然状,我是不是该安静的走开,真的爱你,灰色轨迹
Bigbaby,Laser life,简单爱,演员,最冷的一天
1993058,最好的我,北国,少年游
小于一,imagine,respect,hey jude
the who,misty,your eyes,all i want9
从歌曲库中匹配出歌曲的风格类型
User_name
Like_music
style
周一懵然状
我是不是该安静的走开
流行
周一懵然状
真的爱你
流行
周一懵然状
灰轨迹
流行
Bigbaby
Laser life
摇滚
Bigbaby
简单爱
流行
Bigbaby
演员
流行
bigbaby
最冷的一天
流行
1993058
最好的我
流行
1993058
北国
民谣
1993058
少年游
民谣
小于一
imagine
摇滚
小于一
Respect
摇滚
小于一
Hey jude
摇滚
the who
misty
轻音乐
the who
Your eyes
轻音乐
the who
All I want
轻音乐
导入hive进行行转列去除多余字段
Hive>create table user_style(user_name string,music_name string,style string) row format delimited fields terminated by ‘,’;
Hive>Load data inpath ‘user/’ into table user_style;
Hive>select user_name,concat_ws(‘,’,collect_set(style))from user_style group by user_name;
用sqoop把结果导入mysql
User_name
Style
周一懵然状
流行
Bigbaby
摇滚,流行
1993058
流行,民谣
小于一
摇滚
The who
轻音乐
User_name
varChar
用户名
Passwd
Varchar
密码
Sex
char
性别
Register_date
varchar
注册时间
Create table user(user_name v