Hi,
I was trying to import data from teradata into hadoop using sqoop command. This import includes joining of tables on teradata and import the results to hive. I'm using the --query option of sqoop to insert the SQL query. The SQL query which I'm using is more than 30 lines. The import is failing with the following error.
14/01/10 11:30:28 INFO manager.SqlManager: Using default fetchSize of 1000
14/01/10 11:30:28 INFO tool.CodeGenTool: Beginning code generation
14/01/10 11:30:29 ERROR manager.SqlManager: Error executing statement: com.teradata.jdbc.jdbc_4.util.JDBCException: [Teradata Database] [TeraJDBC 14.00.00.01] [Error 3707] [SQLState 42000] Syntax error, expected something like ';' between an integer and '('.
com.teradata.jdbc.jdbc_4.util.JDBCException: [Teradata Database] [TeraJDBC 14.00.00.01] [Error 3707] [SQLState 42000] Syntax error, expected something like ';' between an integer and '('.
I tried "sqoop eval" to check whether Sqoop can handle such large query. It was successful. It returned me the result on the putty console. But when I use the same SQL in the import command it is not working. I'm using the following command.
sqoop import -libjars /usr/lib/sqoop/lib/tdgssconfig.jar,/usr/lib/sqoop/lib/terajdbc4.jar --driver com.teradata.jdbc.TeraDriver --connect "jdbc:teradata://111.111.111.11/DATABASE=vedw" -m 1 --username uname --password pwd --hive-table PRED_CUST --hive-import --query "SELECT query with JOINS and WHERE \$CONDITIONS" --target-dir /user/hdfs/PRED_CUST
Following is the sqoop eval command which is working fine.
sqoop eval -libjars /usr/lib/sqoop/lib/tdgssconfig.jar,/usr/lib/sqoop/lib/terajdbc4.jar --driver com.teradata.jdbc.TeraDriver --connect "jdbc:teradata://111.111.111.11/DATABASE=vedw" -m 1 --username uname --password pwd --query "SELECT query with JOINS and WHERE"
Please help me with this if there is anything wrong I'm doing. Or please suggest me some workaround. Thank you.
Srikanth