【发布时间】:2019-09-12 13:59:38
【问题描述】:
现在我的蜂巢表带有列 - id, name
和 MySQL 表 - number, id, name
我想将id (from hive) 映射到number (from mysql),将name (from hive) 映射到id (from mysql)。
我使用命令:
sqoop export --hcatalog-database <my_db> --hcatalog-table <my_table> --columns "number,id" \
--connect jdbc:mysql://db...:3306/test \
--username <my_user> --password <my_passwd> --table <my_mysql_table>
但是,它不起作用。
与此案例相同的场景可以正常工作 [1]。可以通过在hdfs上定位hive表,使用如下命令来实现。
sqoop export --export-dir /[hdfs_path] --columns "number,id" \
--connect jdbc:mysql://db...:3306/test \
--username <my_user> --password <my_passwd> --table <my_mysql_table>
是否有任何解决方案可以通过 Hcatalog 实现我的方案?
参考:
[1]。 Sqoop export from hive to oracle with different col names, number of columns and order of columns
【问题讨论】:
标签: hadoop hive sqoop hcatalog