數(shù)據(jù)導(dǎo)入六種方式
1、加載本地文件到hive表
語法



2、加載hdfs文件到hive中

3、加載數(shù)據(jù)覆蓋表中已有的數(shù)據(jù)

4、創(chuàng)建表時通過select加載
create table if not exists default.dept_cats
as select * from dept;
5、創(chuàng)建表通過insert加載

6、創(chuàng)建表的時候通過location指定加載
外部表方式
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');
這樣就可以直接訪問。