JDBC driver for Teradata issue

Connectivity

JDBC driver for Teradata issue

I am new to Teradata. I am using Hadoop Java map-reduce to connect to Teradata via JDBC. I am using the Teradata JDBC Driver 13. I am using Hadoop 20.2.

I am gettign the following stack trace.

11/08/08 14:51:42 INFO mapred.JobClient: Task Id : attempt_201106221259_0073_m_000010_0, Status : FAILED
java.io.IOException: com.teradata.jdbc.TeraDriver
at org.apache.hadoop.mapred.lib.db.DBOutputFormat.getRecordWriter(DBOutputFormat.java:162)
at org.apache.hadoop.mapred.MapTask$DirectMapOutputCollector.(MapTask.java:662)
at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:352)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:307)
at org.apache.hadoop.mapred.Child.main(Child.java:170)

Any pointer to what could be the problem will be highly appreciated. Also, will be happy to provide more info

Thanks

Ranjan
3 REPLIES
Teradata Employee

Re: JDBC driver for Teradata issue

The most likely problem is that your classpath is not correct -- the Teradata JDBC Driver is not available on your classpath.

The Hadoop code calls Class.forName to load the Teradata JDBC Driver class, and if that throws ClassNotFoundException, then the Hadoop code catches it and throws an IOException instead with the same exception message text. That is what you are seeing.

Re: JDBC driver for Teradata issue

Thanks a lot. I made sure the classpath has the tera driver
/home/surasani/ranjan/tdgssconfig.jar:/home/surasani/ranjan/terajdbc4.jar:/var/opt/hadr/hadr/hadoop-0.20.2/hadoop-0.20.2-core.jar:/hadoop-0.20.2-tools.jar:.

could there be any other reasons?

Also, is there working example of using DBOutputFormat with teradriver somewhere I could check?

Thanks
Ranjan

Re: JDBC driver for Teradata issue

Also, the message
java.io.IOException: com.teradata.jdbc.TeraDriver
seems to mean that the driver class was loaded...as it was where the exception was raised. Just a thought.