我正在尝试使用 sqoop 从分区的配置单元表中导出到 mysql。
起初我试着做
$sqoop export --connect jdbc:mysql://<server addr>/<db name> --username <user name> -P --table source_edge_daily --export-dir /path/to/table/<table name> --input-fields-terminated-by '\t' --verbose
命令错误说
Open failed for file /path/to/table/<table name>/<partition name>, attempt to open a directory
当我指向分区目录时
$sqoop export --connect jdbc:mysql://<server addr>/<db name> --username <user name> -P --table source_edge_daily --export-dir /path/to/table/<table name>/<partition name> --input-fields-terminated-by '\t' --verbose
命令失败说
at com.cloudera.sqoop.mapreduce.CombineShimRecordReader.getCurrentKey(CombineShimRecordReader.java:100)
at com.cloudera.sqoop.mapreduce.CombineShimRecordReader.getCurrentKey(CombineShimRecordReader.java:43)
at org.apache.hadoop.mapreduce.lib.input.CombineFileRecordReader.getCurrentKey(CombineFileRecordReader.java:75)
at org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.getCurrentKey(MapTask.java:452)
at org.apache.hadoop.mapreduce.MapContext.getCurrentKey(MapContext.java:57)
at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:144)
at com.cloudera.sqoop.mapreduce.AutoProgressMapper.run(AutoProgressMapper.java:189)
at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:668)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:334)
at org.apache.hadoop.mapred.Child$4.run(Child.java:270)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:396)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1109)
at org.apache.hadoop.mapred.Child.main(Child.java:264)
我还尝试在没有分区键的情况下重新创建 mysql 表,创建分区 mysql 表,一切都失败并显示相同的错误消息