赞
踩
load data local inpath '路径' into/overwrite table 表名
load data inpath 'hdfs路径' into/overwrite table 表名
(select 或者insert )
create table ... as select xxx from 其他表
insert into/overwrite table 表名 select xxx from 其他表
location 'hdfs路径'
load会搬移数据,location是指定数据
语法
create table if not exists default.dept_cats
as select * from dept;
create external table if not exists emp_partition(
empno int,
ename string,
job string,
mgr int,
hiredate string,
sal double,
comm double,
deptno int
)
partitioned by (month string)
row format delimited fields terminated by '\t'
load data local inpath '/opt/datas/emp.txt' into table default.emp_partition partition (month='201803');
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。