sqoop从hdfs导出到mysql中

版权声明:& https://blog.csdn.net/qq_16760101/article/details/84316221

使用sqoop启动命令为:

sqoop export --connect jdbc:mysql://master:3306/test --username root --P --table wordCount --export-dir /b.txt/part* -m 1 --fields-terminated-by ' '

发现执行任务总是失败,后经过查看原始数据形式为:

(a,1)
(b,1)

更改程序使最终结果为:

a 1
b 1

问题得到解决,显然问题为 sqoop指定分隔符不正确&原始数据格式不正确。

猜你喜欢

转载自blog.csdn.net/qq_16760101/article/details/84316221