You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sqoop.apache.org by "Mohammed Niaz (JIRA)" <ji...@apache.org> on 2016/07/22 06:33:20 UTC

[jira] [Created] (SQOOP-2985) Could not get current time from database - DB2 database

Mohammed Niaz created SQOOP-2985:
------------------------------------

             Summary: Could not get current time from database - DB2 database
                 Key: SQOOP-2985
                 URL: https://issues.apache.org/jira/browse/SQOOP-2985
             Project: Sqoop
          Issue Type: Bug
          Components: sqoop2-jdbc-connector
    Affects Versions: 1.4.3
         Environment: Linux, DB2 v10.5.0, IBM BigInsights v3.2.0
            Reporter: Mohammed Niaz
            Priority: Critical


Dear Team,
I am facing below issue when executing below sqoop command to do incremental import to BigSQL table.
Command:
------------
./sqoop import --driver com.ibm.db2.jcc.DB2Driver --connect jdbc:db2://localhost:50000/sample --username xxxx --password xxxx --table student --incremental lastmodified --check-column ts --target-dir /sqooptest/db/student --last-value '2016-07-21-14.41.43'

And got these lines when checking java SqlManager file. Is this method return query compatible with DB2?. 
FileName: org.apache.sqoop.manager.SqlManager
protected String  getCurTimestampQuery() {
     return "SELECT CURRENT_TIMESTAMP()";
   }


16/07/21 15:43:41 WARN manager.SqlManager: SQL exception accessing current timestamp: com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=(;CT CURRENT_TIMESTAMP;<table_expr>, DRIVER=3.66.46
16/07/21 15:43:41 ERROR tool.ImportTool: Encountered IOException running import job: java.io.IOException: Could not get current time from database at org.apache.sqoop.tool.ImportTool.initIncrementalConstraints(ImportTool.java:284)
        at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:398)




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)