priestc
priestc

Reputation: 35150

Debug information with UDF's in Hive

I'm trying to get GeoIP working with hive. I found this: http://www.jointhegrid.com/hive-udf-geo-ip-jtg/index.jsp, which seems to be exactly what I want.

I built the jars (I have no java experience, so I only hope I did this part right), added them to my query and get this:

hive> ADD jar hive-udf-geo-ip-jtg.jar;
Added hive-udf-geo-ip-jtg.jar to class path
Added resource: hive-udf-geo-ip-jtg.jar
hive> ADD jar geo-ip-java.jar;
Added geo-ip-java.jar to class path
Added resource: geo-ip-java.jar
hive> ADD file GeoIPCity.dat;
Added resource: GeoIPCity.dat
hive> create temporary function geoip as 'com.jointhegrid.hive.udf.GenericUDFGeoIP';
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.FunctionTask

Is there a way to find out what exactly is going wrong? return code 1 doesn't tell me much... Is there a log file somewhere?

Upvotes: 3

Views: 5654

Answers (2)

Gyanendra Dwivedi
Gyanendra Dwivedi

Reputation: 5538

Try executing hive UDF with below command

hive --hiveconf hive.root.logger=DRFA --hiveconf hive.log.dir=./logs --hiveconf hive.log.level=DEBUG -e "query"

or

hive --hiveconf hive.root.logger=DRFA --hiveconf hive.log.dir=./logs --hiveconf hive.log.level=DEBUG -f queryscript.hql

The logs would be captured in a file under logs folder (current directory). Please make sure that the logs folder exist.

Try adjusting log level to get right detail.

Upvotes: 0

yhuai
yhuai

Reputation: 410

if you want to see the log of hive, you can use $HIVE_HOME/bin/hive -hiveconf hive.root.logger=INFO,console. You can also change levels (DEBUG, INFO, WARN, ERROR or FATAL) to see if you can get enough information.

Upvotes: 7

Related Questions