使用Sqoop将数据从MySQL导入Hive [英] Using Sqoop to import data from MySQL to Hive

查看:785
本文介绍了使用Sqoop将数据从MySQL导入Hive的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Sqoop(版本1.4.4)将数据从MySQL导入Hive。数据将是其中一个表的子集,即表中的少数列。是否需要事先在Hive中创建表格。或者导入数据将创建命令中指定的名称,如果它不在Hive中?

解决方案

一个href =http://sqoop.apache.org/docs/1.4.4/SqoopUserGuide.html#_importing_data_into_hive> sqoop文档,如果您使用标签,则不必创建任何配置单元表例如:

 <$> 
$ b

例如:--hive-import c $ c> sqoop import --connect jdbc:mysql:// mysql_server:3306 / db_name --username mysql_user --password mysql_pass --table table_name --hive-import

另外...如果您想要在每天的基础上安排完整的数据导入,请考虑 - hive-overwrite 参数例如


I am using Sqoop (version 1.4.4) to import data from MySQL to Hive. The data will be a subset of one of tables, i.e. few columns from a table. Is it necessary to create table in Hive before hand. Or importing the data will create the name specified in the command if it is not in the Hive?

解决方案

As mentioned in the sqoop documentation, you will not have to create any hive tables if you use the --hive-import argument in your command

example:

sqoop import --connect jdbc:mysql://mysql_server:3306/db_name --username mysql_user --password mysql_pass --table table_name --hive-import

Also... consider the --hive-overwrite argument if you want to schedule a full data import, on a daily base for example

这篇关于使用Sqoop将数据从MySQL导入Hive的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆