每日学习
今天加强hive的导入和导出学习:
Insert 导出
1)将查询的结果导出到本地
hive (default)> insert overwrite local directory
'/opt/module/hive/data/export/student'
select * from student;
2)将查询的结果格式化导出到本地
hive(default)>insert overwrite local directory
'/opt/module/hive/data/export/student1'
ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'
select * from student;
3)将查询的结果导出到 HDFS 上(没有 local)
hive (default)> insert overwrite directory '/user/atguigu/student2'
ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'
select * from student;
hive (default)> import table student2
from '/user/hive/warehouse/export/student';