使用Sqoop将数据从MySQL导入Hive [英] Using Sqoop to import data from MySQL to 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屋!