Sqoop1上的sybase iq导入错误

ktecyv1j  于 2021-06-02  发布在  Hadoop
关注(0)|答案(1)|浏览(370)

我试图导入一个数据和连接是好的。list tables语法提供数据库中所有表的名称。但是当我试图运行import查询时,它给出了一个异常。
sqoop命令:

sqoop import  --connect 'jdbc:sybase:Tds:10.100.0.***:5500/DATABASE=iqprod1' --driver 'com.sybase.jdbc3.jdbc.SybDriver'  --username "keswara" --password -p --query "select top 100 * from dw.DM_ADDRESS_ITC \$CONDITIONS" --target-dir "/user/keswara/WT_Address_Itc" --split-by 1 --verbose

错误:

17/03/06 17:07:34 DEBUG manager.SqlManager: Execute getColumnInfoRawQuery : select top 100 * from dw.DM_ADDRESS_ITC   (1 = 0)
17/03/06 17:07:34 DEBUG manager.SqlManager: No connection paramenters specified. Using regular API for making connection.
17/03/06 17:07:35 DEBUG manager.SqlManager: Using fetchSize for next query: 1000
17/03/06 17:07:35 INFO manager.SqlManager: Executing SQL statement: select top 100 * from dw.DM_ADDRESS_ITC   (1 = 0)
17/03/06 17:07:35 ERROR manager.SqlManager: Error executing statement: com.sybase.jdbc3.jdbc.SybSQLException: SQL Anywhere Error -131: Syntax error near '=' on line 1
com.sybase.jdbc3.jdbc.SybSQLException: SQL Anywhere Error -131: Syntax error near '=' on line 1
        at com.sybase.jdbc3.tds.Tds.a(Unknown Source)
        at com.sybase.jdbc3.tds.Tds.nextResult(Unknown Source)
        at com.sybase.jdbc3.tds.Tds.getResultSetResult(Unknown Source)
        at com.sybase.jdbc3.tds.TdsCursor.open(Unknown Source)
        at com.sybase.jdbc3.jdbc.SybStatement.executeQuery(Unknown Source)
        at com.sybase.jdbc3.jdbc.SybPreparedStatement.executeQuery(Unknown Source)
        at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:758)
        at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:767)
        at org.apache.sqoop.manager.SqlManager.getColumnInfoForRawQuery(SqlManager.java:270)
        at org.apache.sqoop.manager.SqlManager.getColumnTypesForRawQuery(SqlManager.java:241)
        at org.apache.sqoop.manager.SqlManager.getColumnTypesForQuery(SqlManager.java:234)
        at org.apache.sqoop.manager.ConnManager.getColumnTypes(ConnManager.java:304)
        at org.apache.sqoop.orm.ClassWriter.getColumnTypes(ClassWriter.java:1833)
        at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1645)
        at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:107)
        at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:478)
        at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:606)
        at org.apache.sqoop.Sqoop.run(Sqoop.java:143)
        at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
        at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:179)
        at org.apache.sqoop.Sqoop.runTool(Sqoop.java:218)
        at org.apache.sqoop.Sqoop.runTool(Sqoop.java:227)
        at org.apache.sqoop.Sqoop.main(Sqoop.java:236)
17/03/06 17:07:35 ERROR tool.ImportTool: Encountered IOException running import job: java.io.IOException: No columns to generate for ClassWriter
        at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1651)
        at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:107)
        at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:478)
        at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:606)
        at org.apache.sqoop.Sqoop.run(Sqoop.java:143)
        at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
        at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:179)
        at org.apache.sqoop.Sqoop.runTool(Sqoop.java:218)
        at org.apache.sqoop.Sqoop.runTool(Sqoop.java:227)
        at org.apache.sqoop.Sqoop.main(Sqoop.java:236)

我错过了什么?非常感谢你的帮助!

oxiaedzo

oxiaedzo1#

你错过了 where . 试试这个:

--query "select top 100 * from dw.DM_ADDRESS_ITC where \$CONDITIONS"

查看sqoop文档了解更多详细信息。

相关问题