使用load语句
语法
将student01.txt数据导入t2
load data local inpath '/root/data/student01.txt' into table t2;
将student01.txt数据导入t3
load data local inpath '/root/data/student01.txt' into table t3;
将/root/下的所有数据文件导入t3表中,并且覆盖原来的数据
load data local inpath '/root/data/' overwrite into table t3;
将HDSF中,/input/student01.txt' 导入到t3
load data inpath '/input/student01.txt' overwrite into table t3;
vi data1.txt
1,Tom,M
3,Mike,M
vi data2.txt
2,Mary,F
load data local inpath '/root/data/data1.txt' into table partition_table partition (gender='M');
load data local inpath '/root/data/data2.txt' into table partition_table partition (gender='F');