Quantcast
Channel: Teradata Downloads - Connectivity
Viewing all articles
Browse latest Browse all 445

Sqoop Import from Teradata with 30 lines of SQL query using –query is failing

$
0
0

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

Forums: 

Viewing all articles
Browse latest Browse all 445

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>