首页 > 解决方案 > Sqoop 无法将数据从 MYSQL 导入 HBASE

问题描述

嗨,我是大数据的新手,我正在尝试从使用 sqoop 导入mysql数据hbase

sqoop import –connect jdbc:mysql://xxx.xxx.xx.xx:3306/FBI_DB –table FBI_CRIME –hbase-table H_FBI_CRIME –column-family cd –hbase-row-key ID –m 1 –username root -P

错误 tool.ImportTool:导入失败:java.io.IOException:没有要为 ClassWriter 生成的列。

有一次我用过––driver com.mysql.jdbc.Driver但还是没有成功。

请帮忙,有什么问题。

标签: mysqlhadoophbasesqoop

解决方案


问题是您必须指定要导入的列的名称,如下所示:

sqoop import --connect jdbc:mysql://xxx.xxx.xx.xx:3306/FBI_DB \
--table FBI_CRIME \
--hbase-table H_FBI_CRIME \
--columns "columnA,columnB" \
--column-family cd \
--hbase-row-key ID \
-m 1 \
--username root -P

推荐阅读