Apache Sqoop incremental load topic. DateTime Incorrect value

#1

sqoop import \

–connect jdbc:mysql://ms.itversity.com:3306/retail_db
–driver com.mysql.jdbc.Driver
–username retail_user
–password itversity
–target-dir /user/siva_chinnaraj/sqoop_import/orders
–num-mappers 2
–query “select * from orders where $CONDITIONS and order_date like ‘2013-%’”
–split-by order_id
19/05/30 13:27:23 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6.2.6.5.0-292
19/05/30 13:27:23 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead.
19/05/30 13:27:23 WARN sqoop.ConnFactory: Parameter --driver is set to an explicit driver however appropriate connection manager is not being set (via --connection-manager). Sqoop is going to fall back to org.apache.sqoop.manager.GenericJdbcManager. Please specify explicitly which connection manager should be used next time.
19/05/30 13:27:23 INFO manager.SqlManager: Using default fetchSize of 1000
19/05/30 13:27:23 INFO tool.CodeGenTool: Beginning code generation
Loading class com.mysql.jdbc.Driver'. This is deprecated. The new driver class iscom.mysql.cj.jdbc.Driver’. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
19/05/30 13:27:24 INFO manager.SqlManager: Executing SQL statement: select * from orders where (1 = 0) and order_date like ‘2013-%’
19/05/30 13:27:24 ERROR manager.SqlManager: Error executing statement: java.sql.SQLException: Incorrect DATETIME value: ‘2013-%’
java.sql.SQLException: Incorrect DATETIME value: ‘2013-%’
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:955)
at com.mysql.cj.jdbc.ClientPreparedStatement.executeQuery(ClientPreparedStatement.java:1005)
at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:777)
at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:786)
at org.apache.sqoop.manager.SqlManager.getColumnInfoForRawQuery(SqlManager.java:289)
at org.apache.sqoop.manager.SqlManager.getColumnTypesForRawQuery(SqlManager.java:260)
at org.apache.sqoop.manager.SqlManager.getColumnTypesForQuery(SqlManager.java:253)
at org.apache.sqoop.manager.ConnManager.getColumnTypes(ConnManager.java:337)
at org.apache.sqoop.orm.ClassWriter.getColumnTypes(ClassWriter.java:1853)
at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1653)
at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:107)
at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:488)
at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:615)
at org.apache.sqoop.Sqoop.run(Sqoop.java:147)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76)
at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:183)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:225)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:234)
at org.apache.sqoop.Sqoop.main(Sqoop.java:243)

Same query works in W3School. Am i missing anything?

0 Likes