FAQ
Hello,

I just came across the GenericUDFDBOutput and was able to successfully write
data to a mysql db.

I tried modifying the connection string to a sql server using jtds library
and for some reason it does not seem to work with jtds.

Has anyone come across the same issue before ?

I did the following steps before running my dboutput udf:


add jar
/home/hadoop/svn/elsharpy/library/mysql-connector-java-5.1.13-bin.jar;
add jar /usr/lib/hive/lib/hive_contrib.jar;
create temporary function dboutput as
'org.apache.hadoop.hive.contrib.genericudf.example.GenericUDFDBOutput';
(ran mysql query... it was all fine... )

add jar /usr/lib/hive/lib/jtds-1.2.5.jar;
(ran sql server query ... following is the stack trace from one of my
reducers
010-12-10 01:52:19,071 ERROR
org.apache.hadoop.hive.contrib.genericudf.example.GenericUDFDBOutput: Driver
loading or connection issue

java.sql.SQLException: No suitable driver found for
jdbc:jtds:sqlserver://(DriverManager.java:602)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at org.apache.hadoop.hive.contrib.genericudf.example.GenericUDFDBOutput.evaluate(GenericUDFDBOutput.java:120)
at org.apache.hadoop.hive.ql.exec.ExprNodeGenericFuncEvaluator.evaluate(ExprNodeGenericFuncEvaluator.java:82)
at org.apache.hadoop.hive.ql.exec.SelectOperator.processOp(SelectOperator.java:73)
at org.apache.hadoop.hive.ql.exec.Operator.process(Operator.java:386)
at org.apache.hadoop.hive.ql.exec.Operator.forward(Operator.java:598)
at org.apache.hadoop.hive.ql.exec.GroupByOperator.forward(GroupByOperator.java:746)
at org.apache.hadoop.hive.ql.exec.GroupByOperator.closeOp(GroupByOperator.java:788)
at org.apache.hadoop.hive.ql.exec.Operator.close(Operator.java:462)
at org.apache.hadoop.hive.ql.exec.ExecReducer.close(ExecReducer.java:258)
at org.apache.hadoop.mapred.ReduceTask.runOldReducer(ReduceTask.java:473)
at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:411)
at org.apache.hadoop.mapred.Child.main(Child.java:170)

Thanks,
Viral

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categorieshive, hadoop
postedDec 10, '10 at 2:12a
activeDec 10, '10 at 2:12a
posts1
users1
websitehive.apache.org

1 user in discussion

Viral Bajaria: 1 post

People

Translate

site design / logo © 2022 Grokbase