Support Questions

Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

error while usin select statement using hive in ambari:

I have added jars esri-geometry-api.jar and spatial-sdk.jar in tmp/udfs/ in file view and refer it in hive view using the script as: ADD JAR /tmp/udfs/esri-geometry-api.jar ADD JAR /tmp/udfs/spatial-sdk.jar

select * from building;

but i get error as

Error while compiling statement: FAILED: ParseException line 4:0 cannot recognize input near 'ADD' 'JAR' 'esri' [ERROR_STATUS]

1 ACCEPTED SOLUTION

@k v vittal hebbar

I assume that lines as you actually wrote are like the below (in two lines with semicolon at the end):

ADD JAR /tmp/udfs/esri-geometry-api.jar;

ADD JAR /tmp/udfs/spatial-sdk.jar;

If that is true, then check whether your ambari view user is mapped to an OS user that has privileges on /tmp/udfs/ located files. Example:

You also have a better option to add these libraries to HDFS as such you can access them from any node with a Hive client.

add jar hdfs://whateverhost:8020/tmp/esri/esri-geometry-api.jar;

Try the hdfs approach.

If this addresses your response please vote and accept it as the best answer.

View solution in original post

3 REPLIES 3

@k v vittal hebbar

I assume that lines as you actually wrote are like the below (in two lines with semicolon at the end):

ADD JAR /tmp/udfs/esri-geometry-api.jar;

ADD JAR /tmp/udfs/spatial-sdk.jar;

If that is true, then check whether your ambari view user is mapped to an OS user that has privileges on /tmp/udfs/ located files. Example:

You also have a better option to add these libraries to HDFS as such you can access them from any node with a Hive client.

add jar hdfs://whateverhost:8020/tmp/esri/esri-geometry-api.jar;

Try the hdfs approach.

If this addresses your response please vote and accept it as the best answer.

should i add above jars in hive view for ambari or hive server node

@k v vittal hebbar

Either one is fine.

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.