我正在尝试使用scoop将数据从mysql数据库导入hdfs,但出现“no columns to generate for classwriter”错误。
这是我的独家新闻:
sqoop import --connect jdbc:mysql://xxxxx.xxxx.us-east-1.rds.amazonaws.com/xxxx --username xxxx --password xxxx --table xxxx --null-string 'NA' --null-non-string '\\N' --warehouse-dir /user/romeo/finalproject/cardMember
下面是错误堆栈:
20/03/08 16:11:27 error manager.sqlmanager:执行语句时出错:com.mysql.jdbc.exceptions.jdbc4.communicationsexception:通信链路故障
最后一个成功发送到服务器的数据包是0毫秒前。驱动程序尚未从服务器接收到任何数据包。com.mysql.jdbc.exceptions.jdbc4.communicationsexception:通信链路故障
最后一个成功发送到服务器的数据包是0毫秒前。驱动程序尚未从服务器接收到任何数据包。在sun.reflect.nativeconstructoraccessorimpl.newinstance0(本机方法)在sun.reflect.nativeconstructoraccessorimpl.newinstance(nativeconstructoraccessorimpl)。java:57)在sun.reflect.delegatingconstructoraccessorimpl.newinstance(delegatingconstructoraccessorimpl。java:45)在java.lang.reflect.constructor.newinstance(constructor。java:526)在com.mysql.jdbc.util.handlenewinstance(util。java:411)在com.mysql.jdbc.sqlerror.createcommunicationsexception(sqlerror。java:1121)在com.mysql.jdbc.mysqlio。java:357)在com.mysql.jdbc.connectionimpl.coreconnect(connectionimpl。java:2484)在com.mysql.jdbc.connectionimpl.connectonetryonly(connectionimpl。java:2521)在com.mysql.jdbc.connectionimpl.createnewio(connectionimpl。java:2306)在com.mysql.jdbc.connectionimpl。java:839)在com.mysql.jdbc.jdbc4connection.(jdbc4connection。java:49)位于sun.reflect.nativeconstructoraccessorimpl.newinstance0(本机方法)sun.reflect.nativeconstructoraccessorimpl.newinstance(nativeconstructoraccessorimpl。java:57)在sun.reflect.delegatingconstructoraccessorimpl.newinstance(delegatingconstructoraccessorimpl。java:45)在java.lang.reflect.constructor.newinstance(constructor。java:526)在com.mysql.jdbc.util.handlenewinstance(util。java:411)在com.mysql.jdbc.connectionimpl.getinstance(connectionimpl。java:421)在com.mysql.jdbc.nonregisteringdriver.connect(nonregisteringdriver。java:350)在java.sql.drivermanager.getconnection(drivermanager。java:571)在java.sql.drivermanager.getconnection(drivermanager。java:215)在org.apache.sqoop.manager.sqlmanager.makeconnection(sqlmanager。java:903) 在org.apache.sqoop.manager.genericjdbcmanager.getconnection(genericjdbcmanager。java:52)在org.apache.sqoop.manager.sqlmanager.execute(sqlmanager。java:762)在org.apache.sqoop.manager.sqlmanager.execute(sqlmanager。java:785)在org.apache.sqoop.manager.sqlmanager.getcolumninfoforrawquery(sqlmanager。java:288)在org.apache.sqoop.manager.sqlmanager.getcolumntypesforrawquery(sqlmanager。java:259)在org.apache.sqoop.manager.sqlmanager.getcolumntypes(sqlmanager。java:245)在org.apache.sqoop.manager.connmanager.getcolumntypes(connmanager。java:333)在org.apache.sqoop.orm.classwriter.getcolumntypes(classwriter。java:1858)在org.apache.sqoop.orm.classwriter.generate(classwriter。java:1657)在org.apache.sqoop.tool.codegentool.generateorm(codegentool。java:106)在org.apache.sqoop.tool.importtool.importtable(importtool。java:494)在org.apache.sqoop.tool.importtool.run(importtool。java:621)在org.apache.sqoop.sqoop.run(sqoop。java:147)在org.apache.hadoop.util.toolrunner.run(toolrunner。java:70)在org.apache.sqoop.sqoop.runsqoop(sqoop。java:183)在org.apache.sqoop.sqoop.runtool(sqoop。java:234)在org.apache.sqoop.sqoop.runtool(sqoop。java:243)在org.apache.sqoop.sqoop.main(sqoop。java:252)原因:java.net.unknownhostexception:upgradawsrds.cpclxrkdvwmz.us-east1.rds.amazonaws.com位于java.net.inet4addressimpl.lookupallhostaddr(本机方法)位于java.net.inetaddress$1.lookupallhostaddr(inetaddress)。java:901)在java.net.inetaddress.getaddressesfromnameservice(inetaddress。java:1293)在java.net.inetaddress.getallbyname0(inetaddress。java:1246)在java.net.inetaddress.getallbyname(inetaddress。java:1162)在java.net.inetaddress.getallbyname(inetaddress。java:1098)在com.mysql.jdbc.standardsocketfactory.connect(standardsocketfactory。java:249)在com.mysql.jdbc.mysqlio。java:307) ... 33 more 20/03/08 16:11:27错误tool.importtool:导入失败:java.io.ioexception:在org.apache.sqoop.orm.classwriter.generate(classwriter)没有要为classwriter生成的列。java:1663)在org.apache.sqoop.tool.codegentool.generateorm(codegentool。java:106)在org.apache.sqoop.tool.importtool.importtable(importtool。java:494)在org.apache.sqoop.tool.importtool.run(importtool。java:621)在org.apache.sqoop.sqoop.run(sqoop。java:147)在org.apache.hadoop.util.toolrunner.run(toolrunner。java:70)在org.apache.sqoop.sqoop.runsqoop(sqoop。java:183)在org.apache.sqoop.sqoop.runtool(sqoop。java:234)在org.apache.sqoop.sqoop.runtool(sqoop。java:243)在org.apache.sqoop.sqoop.main(sqoop。java:252)
你知道怎么解决吗?先谢谢你。
1条答案
按热度按时间2admgd591#
从stacktrace可以很清楚地看出,这是由java.net.unknownhostexception关于uri upgradawsrds.cpclxrkdvwmz.us-east1.rds.amazonaws.com的异常引起的。uri不正确或它指向的dns服务器未解析。更新uri以更新dns。