row format delimited fields terminated by ‘\t’;
2.2上传(6个)源文件到该hive表的HDFS路径下
![](https://img-blog.csdnimg.cn/direct/c0eb55c8031846318238ae7d094d863f.png)
##### 3.查询数据
select * from t_all_hero;
![](https://img-blog.csdnimg.cn/direct/9211abf933aa4a01881d8b1708b554e6.png)
3.1查询出所有的archer数据
select * from t_all_hero where role_main=‘archer’;
问:虽然我们实现了需求, 但是需要进行全表扫描, 如何精准的获取到我们想要的数据呢?
答:可以采用分区表的思路来管理, 把各个职业的数据放到不同的文件夹中即可
##### 4.创建分区数据表
– 1. 创建分区表, 指定分区字段.
create table t_all_hero_part(
id int comment ‘ID’,
name string comment ‘英雄’,
hp_max int comment ‘最大生命’,
mp_max int comment ‘最大法力’,
attack_max int comment ‘最高物攻’,
defense_max int comment ‘最大物防’,
attack_range string comment ‘攻击范围’,
r