热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

sqoop将数据从MySQL导入_使用sqoop将数据从mysql导入到hive

参考文档:https:segmentfault.coma1190000002532293测试环境:完全分布式安装HadoopHive安装(使用默认的de

参考文档:https://segmentfault.com/a/1190000002532293

测试环境:

完全分布式安装Hadoop

Hive安装(使用默认的derby存储元数据)

sqoop的安装

当然还是mysql已安装(使用iso文件建立本地仓库)

测试数据

MariaDB [(none)]> use testdb;

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A

Database changed

MariaDB [testdb]> select * from emp;

+------+---------+--------------+--------+------+

| id | name | deg | salary | dept |

+------+---------+--------------+--------+------+

| 1201 | gopal | manmager | 50000 | TP |

| 1202 | manisha | Proof reader | 50000 | TP |

| 1203 | kalil | php dev | 50000 | TP |

+------+---------+--------------+--------+------+

3 rows in set (0.00 sec)

MariaDB [testdb]>

导入数据

[root@master conf]# sqoop import --connect jdbc:mysql://localhost:3306/testdb --username root --password 000000 --table emp --fields-terminated-by '\t' --lines-terminated-by "\n" --hive-import --hive-overwrite --create-hive-table --hive-table emp --delete-target-dir



推荐阅读
author-avatar
从1前2有3个4人_706
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有