📅  最后修改于: 2020-12-03 03:49:29             🧑  作者: Mango
在动态分区中,表中存在分区列的值。因此,不需要手动传递分区列的值。
hive> use show;
hive> set hive.exec.dynamic.partition=true;
hive> set hive.exec.dynamic.partition.mode=nonstrict;
hive> create table stud_demo(id int, name string, age int, institute string, course string)
row format delimited
fields terminated by ',';
hive> load data local inpath '/home/codegyani/hive/student_details' into table stud_demo;
hive> create table student_part (id int, name string, age int, institute string)
partitioned by (course string)
row format delimited
fields terminated by ',';
hive> insert into student_part
partition(course)
select id, name, age, institute, course
from stud_demo;
hive> select * from student_part;
hive> select * from student_part where course= "java ";
在这种情况下,我们不会检查整个数据。因此,这种方法改善了查询响应时间。
hive> select * from student_part where course= "hadoop";