赞
踩
问题:
通过sqoop工具将mysql中的数据导入到hive中
sqoop import --connect jdbc:mysql://master:3306/mf --username root --password xxxx --table t_activity_page --split-by id --delete-target-dir --hive-import -m 1
报如下错误:
ERROR exec.DDLTask: java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.ObjectMapper.readerFor(Ljava/lang/Class;)Lcom/fasterxml/jackson/databind/ObjectReader;
at org.apache.hadoop.hive.common.StatsSetupConst$ColumnStatsAccurate.<clinit>(StatsSetupConst.java:165)
at org.apache.hadoop.hive.common.StatsSetupConst.parseStatsAcc(StatsSetupConst.java:297)
at org.apache.hadoop.hive.common.StatsSetupConst.setBasicStatsState(StatsSetupConst.java:230)
at org.apache.hadoop.hive.common.StatsSetupConst.setBasicStatsStateForCreateTable(StatsSetupConst.java:292)
at org.apache.hadoop.hive.ql.plan.CreateTableDesc.toTable(CreateTableDesc.java:839)
at org.apache.hadoop.hive.ql.exec.DDLTask.createTable(DDLTask.java:4321)
at org.apache.hadoop.hive.ql.exec.DDLTask.execute(DDLTask.java:354)
at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:199)
at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:100)
at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:2183)
at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1839)
at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1526)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1237)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1227)
原因:
sqoop与hive使用的jackson包的版本冲突导致
解决办法:
将hive的lib目录下的jackson相关jar包拷贝到sqoop的lib目录下
cp $HIVE_HOME/lib/jackson*.jar $SQOOP_HOME/lib/
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。