hive导入csv文件,并查询(电子竞技案例)

在hive中建表并导入csv文件

create table game(
  idNo int,
  TotalMoney float,
  GameName string,
  Genre string,
  PlayerNo int,
  TournamentNo int,
  Top_Country string,
  Top_Country_Earings float,
  Releaseyear int
)
row format delimited fields terminated by',';

load data local inpath '/home/hsx/ESport_Earnings.csv' into table game ;

csv文件部分内容

 1.那个游戏最赚钱  --->Dota 2    2.274199045E8

select GameName,TotalMoney 
from game 
where TotalMoney in (
select max(TotalMoney) 
from game
);


2.那一个国家是电竞大国   --->United States    1.0771858407999998E8

select * 
from (
select Top_Country,sum(Top_Country_Earnings) as p  
from game  
group by Top_Country) as a 
where p in(
select max(a) 
from (
select sum(Top_Country_Earnings) as a 
from game 
group by Top_Country) as temp);


3.那个国家人均获得奖金多 ---->Poland    65000.0    1

select * 
from (
select Top_Country,sum(Top_Country_Earnings) as a,sum(TournamentNo) as b 
from game  
group by Top_Country) as pp 
where a/b in (
select max(a/b) 
from (
select Top_Country,sum(Top_Country_Earnings) as a,sum(TournamentNo) as b 
from game  
group by Top_Country) as p);


4.策略类游戏的趋势,每年增长率

5.最近一年,什么游戏增长率最强劲

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值