Sqoop导入停止

时间:2016-11-26 18:53:18

标签: sqoop

我正在尝试将一个表从mysql导入到HDFS,但它在这里暂停,如下所示:

sqoop import --connect jdbc:mysql://localhost/movielens --username root --table tutorials_tbl --m 1

16/11/26 10:47:33 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.

16/11/26 10:47:33 INFO tool.CodeGenTool: Beginning code generation

16/11/26 10:47:34 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM `tutorials_tbl` AS t LIMIT 1

16/11/26 10:47:34 INFO orm.CompilationManager: HADOOP_HOME is /usr/lib/hadoop

16/11/26 10:47:34 INFO orm.CompilationManager: Found hadoop core jar at: /usr/lib/hadoop/hadoop-core.jar

16/11/26 10:47:36 ERROR orm.CompilationManager: Could not rename /tmp/sqoop-training/compile/f150b283edf7b39ed9facc57a781542e/tutorials_tbl.java to /home/training/./tutorials_tbl.java

java.io.IOException: Destination '/home/training/./tutorials_tbl.java' already exists
        at org.apache.commons.io.FileUtils.moveFile(FileUtils.java:1811)
        at com.cloudera.sqoop.orm.CompilationManager.compile(CompilationManager.java:229)
        at com.cloudera.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:85)
        at com.cloudera.sqoop.tool.ImportTool.importTable(ImportTool.java:369)
        at com.cloudera.sqoop.tool.ImportTool.run(ImportTool.java:455)
        at com.cloudera.sqoop.Sqoop.run(Sqoop.java:146)
        at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
        at com.cloudera.sqoop.Sqoop.runSqoop(Sqoop.java:182)
        at com.cloudera.sqoop.Sqoop.runTool(Sqoop.java:221)
        at com.cloudera.sqoop.Sqoop.runTool(Sqoop.java:230)
        at com.cloudera.sqoop.Sqoop.main(Sqoop.java:239)
16/11/26 10:47:36 INFO orm.CompilationManager: Writing jar file: /tmp/sqoop-training/compile/f150b283edf7b39ed9facc57a781542e/tutorials_tbl.jar

16/11/26 10:47:36 WARN manager.MySQLManager: It looks like you are importing from mysql.

16/11/26 10:47:36 WARN manager.MySQLManager: This transfer can be faster! Use the --direct

16/11/26 10:47:36 WARN manager.MySQLManager: option to exercise a MySQL-specific fast path.

16/11/26 10:47:36 INFO manager.MySQLManager: Setting zero DATETIME behavior to convertToNull (mysql)

16/11/26 10:47:36 INFO mapreduce.ImportJobBase: Beginning import of tutorials_tbl

这是工作的最后一行。 提前谢谢!

1 个答案:

答案 0 :(得分:0)

Sqoop是一个仅限Map的工作,因此遵循MR的所有语义。

请删除" / home / training /./ tutorials_tbl.java"并重新运行你的工作。