mysql - 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
但还是没有成功。
请帮忙,有什么问题。
解决方案
问题是您必须指定要导入的列的名称,如下所示:
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
推荐阅读
- dictionary - 如何实现地图缩减算法以在图中查找所有长度为 2 的路径
- google-apps-script - Google Apps 脚本 - 有条件地将数据从其他 Google 表格检索到概览表格
- r - 带 boxcox 的线性模型,用于带零的数据框。无法预测所需的值
- python - KeyError 排序数据框 - 无法识别列名/索引
- vb.net - 如何使用鼠标滚轮将 ListView 滚动一行而不是默认的三行?
- python - 没有文件 IO 的多进程和多进程:OSError:[Errno 24] 打开的文件太多
- amcharts - 在 amcharts 中展开和折叠条形图
- apache-spark - Gradle 测试有效,但 gradle 覆盖有测试失败
- sql - 如何找回上一期的输赢数据?
- python - Keras 模型精度没有提高 - 图像分类