[Hive_8] Hive 设计优化


0. 说明

  在 Hive 中,数据库是一个文件夹,表也是文件夹

  partition,是一个字段,是文件

  前提:在 Hive 进行 where 子句查询的时候,会将条件语句和全表进行比对,搜索出所需的数据,性能极差,partition 就是为了避免全表扫描


1. 分区

  1.1 创建非分区表 user_nopar

    create table user_nopar
    (id int, name string, age int, province string, city string)
    row format delimited
    fields terminated by '\t';

  1.2 加载数据

load data local inpath '/home/centos/files/user_nopar.txt' into table user_nopar;




猜你喜欢

转载自www.cnblogs.com/share23/p/10225549.html