3

我正在Sqoop 1.4.3使用hadoop 1.2.4hive 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 使其正常工作..?

4

1 回答 1

4

您遇到了版本冲突,很可能您在 Hadoop 2.0 上运行在 Hadoop 1.0 上编译的代码。这是因为 Hadoop 1.0 和 2.0 大多不兼容,因此您应该确保下载与您的 Hadoop 发行版匹配的 Sqoop 版本。

更多详情,请看这里

于 2013-06-04T13:24:39.617 回答