Closed parker20121 closed 10 years ago
The fix was to put the jar files in /usr/lib/hadoop/lib
The other way would be "add jar ..." statements in the Query Editor, before the "create temporary function ..." statements.
@randallwhitman that should be taken care of in the file resources added to the left.
I tried adding the "add jar" commands in the query window and linking the jar files as resources in the GUI. Both didn't work. It didn't work in Cloudera or HortonWorks. You'll see in the log output above that it did try to add the jar files to the class path, which still through the error.
Hence the workaround of copying to lib
, got it.
I'm working with the latest version of HortonWorks sandbox, version 2.1. It uses Hive 0.13.0.
I created a database table
create table test2 (id INT, latitude DOUBLE, longitude DOUBLE) ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' STORED AS TEXTFILE; load data local inpath 'spatialdata.txt' into table test2;
and import a small data set contained in a text file, spatialdata.txt.
It has the following data:
id, longitude, latitude 1, 0.0, 0.0 2, 0.0, 4.0 3, 4.0, 4.0 4, 4.0, 0.0 5, 0.0, 0.0
I went through their Hive query interface, and added the two jars
I ran the query and got the following results:
OK converting to local hdfs://sandbox.hortonworks.com:8020/user/hue/esri-geometry-api.jar Added /tmp/55573121-b937-4ea7-8e63-0811c2b29f50_resources/esri-geometry-api.jar to class path Added resource: /tmp/55573121-b937-4ea7-8e63-0811c2b29f50_resources/esri-geometry-api.jar converting to local hdfs://sandbox.hortonworks.com:8020/user/hue/spatial-sdk-hive-1.0.3-SNAPSHOT.jar Added /tmp/55573121-b937-4ea7-8e63-0811c2b29f50_resources/spatial-sdk-hive-1.0.3-SNAPSHOT.jar to class path Added resource: /tmp/55573121-b937-4ea7-8e63-0811c2b29f50_resources/spatial-sdk-hive-1.0.3-SNAPSHOT.jar FAILED: SemanticException [Error 10014]: Line 1:76 Wrong arguments 'latitude': The UDF implementation class 'com.esri.hadoop.hive.ST_Point' is not present in the class path
From what I can tell, my small example follows many of the on-line ones. I'm not sure why it can't find the function.