我的RDBMS中有表。现在,我选择了该表的第3列作为我的HIVE表的分区列。
现在,我如何轻松地将我的RDBMS表的数据导入HIVE表(考虑分区列)?
发布于 2017-09-17 18:30:54
它只适用于静态分区。有关更多详细信息,请参阅以下sqoop脚本:
sqoop import
--connect "jdbc:mysql://quickstart.cloudera:3306/prac"
--username root
--password cloudera
--hive-import
--query "select id,name,ts from student where city='Mumbai' and \$CONDITIONS"
--hive-table prac.student
--hive-partition-key city
--hive-partition-value 'Mumbai'
--target-dir /user/mangesh/sqoop_import/student_temp5
--split-by id 发布于 2015-03-14 04:55:22
可以使用sqoop将rdbms导入hive。
以下是导入到分区表的相关信息:
http://sqoop.apache.org/docs/1.4.4/SqoopUserGuide.html#_importing_data_into_hive
通过指定--
- partition -key和-- Hive -partition-value参数,您可以告诉Sqoop作业将配置单元的数据导入特定分区。分区值必须为字符串。有关分区的更多详细信息,请参阅配置单元文档。
发布于 2018-12-12 22:10:39
对于动态分区,您可以使用如下命令
sqoop import \
--connect "jdbc:mysql://quickstart.cloudera:3306/prac" \
--username root \
--password cloudera \
--table <mysql -tablename> \
--hcatalog-database <hive-databasename> \
--hcatalog-table <hive-table name> \ https://stackoverflow.com/questions/29016809
复制相似问题