我正在Sqoop 1.4.3
使用hadoop 1.2.4
和hive 0.11.0
当我尝试进行sqoop导入时:它会抛出IncompatibleClassChangeError.
任何有关修复此问题的建议......
使用了Sqoop cmd:
sqoop import --connect jdbc:mysql://localhost:3306/employees \
--username test --password test
跟踪:
Exception in thread "main" java.lang.IncompatibleClassChangeError: Found class org.apache.hadoop.mapreduce.JobContext, but interface was expected
at org.apache.sqoop.config.ConfigurationHelper.getJobNumMaps(ConfigurationHelper.java:53)
at com.cloudera.sqoop.config.ConfigurationHelper.getJobNumMaps(ConfigurationHelper.java:36)
at org.apache.sqoop.mapreduce.db.DataDrivenDBInputFormat.getSplits(DataDrivenDBInputFormat.java:121)
at org.apache.hadoop.mapred.JobClient.writeNewSplits(JobClient.java:1054)
at org.apache.hadoop.mapred.JobClient.writeSplits(JobClient.java:1071)
at org.apache.hadoop.mapred.JobClient.access$700(JobClient.java:179)
at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:983)
at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:936)
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:1190)
at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:936)
at org.apache.hadoop.mapreduce.Job.submit(Job.java:550)
at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:580)
at org.apache.sqoop.mapreduce.ImportJobBase.doSubmitJob(ImportJobBase.java:173)
at org.apache.sqoop.mapreduce.ImportJobBase.runJob(ImportJobBase.java:151)
at org.apache.sqoop.mapreduce.ImportJobBase.runImport(ImportJobBase.java:221)
at org.apache.sqoop.manager.SqlManager.importTable(SqlManager.java:545)
at org.apache.sqoop.manager.MySQLManager.importTable(MySQLManager.java:111)
at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:403)
at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:476)
at org.apache.sqoop.Sqoop.run(Sqoop.java:145)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:181)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:220)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:229)
at org.apache.sqoop.Sqoop.main(Sqoop.java:238)
任何人都可以建议我们可以配置哪个版本的Sqoop让这个工作..?
答案 0 :(得分:4)
您遇到版本冲突,很可能您正在Hadoop 2.0上运行在Hadoop 1.0上编译的代码。这是因为Hadoop 1.0和2.0大多不兼容,所以你应该确保下载与你的Hadoop发行版匹配的Sqoop版本。
有关详细信息,请查看here。