将数据导入hive,将数据从hive导出
2018-01-04 14:19
218 查看
一:将数据导入hive(六种方式)
1.从本地导入
load data local inpath 'file_path' into table tbname;
用于一般的场景。
2.从hdfs上导入数据
load data inpath ‘hafd_file_path’ into table tbname;
使用与大数据的存储
3.load方式的覆盖
load data local inpath 'file_path' overwrite into table tbname;
用于零时表。
4.子查询方式
create table tb2 as select * from tb1;
5.insert into
insert into table tb2 select q1;
6.location
然后put就好。
在HDFS上看效果
二:将数据从hive里导出(四种方式)
1.insert方式
1)保存到本地
insert overwrite local directory 'path' select q1;
但是效果不好,没有分隔符
insert overwrite local directory 'path' row format delimited fields terminated by '\t' select q1;
2)保存到HDFS上
insert overwrite directory 'hdfs_path' select * from dept;
注意点:hdfs_path必须存在
1.从本地导入
load data local inpath 'file_path' into table tbname;
用于一般的场景。
2.从hdfs上导入数据
load data inpath ‘hafd_file_path’ into table tbname;
使用与大数据的存储
3.load方式的覆盖
load data local inpath 'file_path' overwrite into table tbname;
用于零时表。
4.子查询方式
create table tb2 as select * from tb1;
5.insert into
insert into table tb2 select q1;
6.location
然后put就好。
在HDFS上看效果
二:将数据从hive里导出(四种方式)
1.insert方式
1)保存到本地
insert overwrite local directory 'path' select q1;
但是效果不好,没有分隔符
insert overwrite local directory 'path' row format delimited fields terminated by '\t' select q1;
2)保存到HDFS上
insert overwrite directory 'hdfs_path' select * from dept;
注意点:hdfs_path必须存在
相关文章推荐
- kettle连接Hive中数据导入导出
- Hive数据的导入和导出
- hive数据导入导出和常用操作
- 【源】从零自学Hadoop(17):Hive数据导入导出,集群数据迁移下
- hive导入和导出数据
- Hive数据导入、sqoop数据导入导出
- sqoop导入导出表/数据到Hive
- Hive表的建立和导入导出数据
- 利用sqoop将hive数据导入导出数据到mysql (转)
- 【源】从零自学Hadoop(16):Hive数据导入导出,集群数据迁移上
- hive导入导出数据案例
- 使用Sqoop将HDFS/Hive/HBase与MySQL/Oracle中的数据相互导入、导出
- hive 的导入导出数据的命令汇总
- Hive数据导入与导出
- Sqoop_具体总结 使用Sqoop将HDFS/Hive/HBase与MySQL/Oracle中的数据相互导入、导出
- hive数据的导入导出
- HIVE数据表的导入导出
- Hive数据导入和导出
- Hive常用数据导入导出总结
- Sqoop数据迁移,工作机制,sqoop安装(配置),Sqoop的数据导入,导入表数据到HDFS,导入关系表到HIVE,导入到HDFS指定目录,导入表数据子集,按需导入,增量导入,sqoop数据导出