form student1
insert overwrite table copy_student3 select *
insert oberwrite table cpoy_student4 select *;
desc student1;
使用 ORDER BY 查询的时候,为了优化查询的速度,使用 hive.mapred.mode 属性。
与数据库中 ORDER BY 的区别在于,在 hive.mapred.mode=strict 模式下必须指定limit ,否则执行会报错。
set hive.mapred.mode=strict;
select * from group_test order by uid limit 5;
create index user_index on table user(id) as ‘org.apache.hadoop.hive.ql.index.compact.CompactIndexHandler’ with deferred rebuild IN TABLE user_index_table;
使用 index_test 表,在属性 id 上创建一个索引 index1_index_test 。
create index index1_index_test on table index_test(id) as ‘org.apache.hadoop.hive.ql.index.compact.CompactIndexHandler’ WITH DEFERERD REBUILD;
drop index user_index on user;
show index on user;
CREATE TABLE table_name(
…
)
PARTITION BY (dt STRING,country STRING);
create temporary function IFNullBol as ‘com.pingan.jrkj.datacenter.hive.udf.IFNullBol’;
Hive Shell常用操作: https://www.cnblogs.com/skyl/p/4736129.html
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/4380/viewspace-2821445/ ,如需转载,请注明出处,否则将追究法律责任。