Hive:insert into table 与 insert overwrite table 区别
创建测试表,来测试看看测试结果:
create table test(name string,pwd string,createdate string)row format delimited fields terminated by ',';
第一步:使用insert into 插入数据到表中:
insert into test(name,pwd,createdate)values('name1','pwd1','2017-06-20 14:14:09'); insert into test(name,pwd,createdate)values('name1','pwd1','2017-06-20 14:14:09'); insert into test(name,pwd,createdate)values('name2','pwd2','2017-06-20 14:14:09'); insert into test(name,pwd,createdate)values('name2','pwd2','2017-06-20 14:14:09'); 0: jdbc:hive2://10.78.152.52:21066/> select * from test; +------------+-----------+----------------------+--+ | test.name | test.pwd | test.createdate | +------------+-----------+----------------------+--+ | name1 | pwd1 | 2017-06-20 14:14:09 | | name1 | pwd1 | 2017-06-20 14:14:09 | | name2 | pwd2 | 2017-06-20 14:14:09 | | name2 | pwd2 | 2017-06-20 14:14:09 | +------------+-----------+----------------------+--+
第二步:不清理以上插入的记录,直接执行insert overwirte,并查询分析结果:
insert overwrite table test select 'name1' as name,'pwd1' as pwd,'2017-06-20 14:14:09' as createdate; insert overwrite table test select 'name2' as name,'pwd2' as pwd,'2017-06-20 14:14:09' as createdate; insert overwrite table test select 'name2' as name,'pwd2' as pwd,'2017-06-20 14:14:09' as createdate; insert overwrite table test select 'name3' as name,'pwd3' as pwd,'2017-06-20 14:14:09' as createdate; 0: jdbc:hive2://10.78.152.62:21066/> select * from test; +------------+-----------+----------------------+--+ | test.name | test.pwd | test.createdate | +------------+-----------+----------------------+--+ | name3 | pwd3 | 2017-06-20 14:14:09 | +------------+-----------+----------------------+--+
第三步:不清理上边步骤执行后的结果,接着执行以下sql语句,并查询结果:
insert overwrite table test select 'name2' as name,'pwd2' as pwd,'2017-06-20 14:14:09' as createdate; 0: jdbc:hive2://10.78.152.62:21066/> select * from test; +------------+-----------+----------------------+--+ | test.name | test.pwd | test.createdate | +------------+-----------+----------------------+--+ | name2 | pwd2 | 2017-06-20 14:14:09 | +------------+-----------+----------------------+--+
基础才是编程人员应该深入研究的问题,比如:
1)List/Set/Map内部组成原理|区别
2)mysql索引存储结构&如何调优/b-tree特点、计算复杂度及影响复杂度的因素。。。
3)JVM运行组成与原理及调优
4)Java类加载器运行原理
5)Java中GC过程原理|使用的回收算法原理
6)Redis中hash一致性实现及与hash其他区别
7)Java多线程、线程池开发、管理Lock与Synchroined区别
8)Spring IOC/AOP 原理;加载过程的。。。
【+加关注】。