向一个定义了分区的空表中插入数据,命令如下:
insert overwrite table t_name
partition (par_1)
select t1.field1 as field1, t1.field2 as field2, t1.field3 as par_1
from (
select * from t
内表数据加载
创建表时加载
create table newtable as select col1,col2 from oldtable
hive> create table testNew as select name,addr from testtable;
hive> select * from testNew;
OK
liguodong