hive中加载数据的方式:
1、加载本地数据到hive表中:
load data local inpath '/opt/hive-0.13.1/emp.txt' into table emp ;
hive> load data local inpath '/opt/hive-0.13.1/emp.txt' into table emp ;
Copying data from file:/opt/hive-0.13.1/emp.txt
Copying file: file:/opt/hive-0.13.1/emp.txt
Loading data to table db_hive_0927.emp
Table db_hive_0927.emp stats: [numFiles=1, numRows=0, totalSize=656, rawDataSize=0]
OK
Time taken: 4.471 seconds
2、加载HDFS中的数据到表中:
load data inpath '/emp.txt' into table emp ;
hive> load data inpath '/emp.txt' into table emp ;
Loading data to table db_hive_0927.emp
Table db_hive_0927.emp stats: [numFiles=2, numRows=0, totalSize=1312, rawDataSize=0]
OK
Time taken: 11.055 seconds
3、创建表的时候加载数据:
as select 和 like
create table db_hive_0927.emp_load as select empno, e