Created 07-01-2017 11:49 AM
Hi,
I am trying to create hplsql function using details present in http://www.hplsql.org/udf.
However when i am trying to execute it , it throws error.
/home/devRht/hplsql/hplsql-0.3.17/hplsql.jar does not exist
However i can see that jar name is hplsql-0.3.17.jar which is present in above path. So why is it not picking up correct name?
I have my hplsql file also configured same way.
export PATH=$PATH:/home/devRht/hplsql/hplsql-0.3.17/
SCRIPTPATH=${0%/*} java -cp $SCRIPTPATH:$HADOOP_CLASSPATH:$SCRIPTPATH/hplsql-0.3.17.jar:$SCRIPTPATH/antlr-runtime-4.5.jar $HADOOP_OPTS org.apache.hive.hplsql.Hplsql "$@ "
what is the issue i am not able to understand ?
Created 07-07-2017 07:46 AM
Try hplsql as java -cp /home/devRht/hplsql/hplsql-0.3.17/hplsql.jar:/home/devRht/hplsql/hplsql-0.3.17/antlr-runtime-4.5.jar:$HADOOP_CLASSPATH org.apache.hive.hplsql.Hplsql "$@ "
Created 07-07-2017 07:46 AM
Try hplsql as java -cp /home/devRht/hplsql/hplsql-0.3.17/hplsql.jar:/home/devRht/hplsql/hplsql-0.3.17/antlr-runtime-4.5.jar:$HADOOP_CLASSPATH org.apache.hive.hplsql.Hplsql "$@ "
Created 07-07-2017 10:04 AM
hi Sindhu,
Thanks for the reply.
I tried to change as per your suggestion :
java -cp /home/devRht/hplsql/hplsql-0.3.17/hplsql-0.3.17.jar:/home/devRht/hplsql/hplsql-0.3.17/antlr-runtime-4.5.jar:$HADOOP_OPTS org.apache.hive.hpl sql.Hplsql "$@"
but now its showing below error
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/cli/ParseException at org.apache.hive.hplsql.Exec.<init>(Exec.java:87) at org.apache.hive.hplsql.Hplsql.main(Hplsql.java:23) Caused by: java.lang.ClassNotFoundException: org.apache.commons.cli.ParseException at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 2 more
thanks,
Rishit Shah
Created 07-07-2017 10:54 AM
Hi Sindhu,
i could solve it with this:
java -cp $SCRIPTPATH:$HADOOP_CLASSPATH:/home/devRht/hplsql/hplsql-0.3.17/hplsql-0.3.17.jar:/home/devRht/hplsql/hplsql-0.3.17/antlr-runtime-4.5.jar $H ADOOP_OPTS org.apache.hive.hplsql.Hplsql "$@"
Created 07-07-2017 12:57 PM
Hi Sindhu,
the above just resolved the issue for normal function.
Now when i am trying to run frunction for hive as a UDF hplsql, it throws error.
Failed with exception java.io.IOException:org.apache.hadoop.hive.ql.metadata.HiveException: Error evaluating hplsql
Below steps followed:
add jar /usr/hdp/current/hive-server2-hive2/lib/antlr4-runtime-4.5.jar;
add jar /usr/hdp/2.6.0.3-8/hive2/lib/hive-hplsql-2.1.0.2.6.0.3-8.jar;
add jar /home/devRht/hplsql/hplsql-0.3.17/hplsql-0.3.17.jar;
CREATE TEMPORARY FUNCTION hplsql AS 'org.apache.hive.hplsql.Udf';
add file /home/devRht/hplsql/hplsql-0.3.17/hplsql-site.xml;
add file /home/devRht/hplsql/hplsql-0.3.17/hplsql;
thanks,
Rishit Shah
Created 07-08-2017 03:21 AM
@Rishit shah Can you open a new question for this issue? This will help community with better search on issues.
Created 07-10-2017 04:11 AM
Hi @Pardeep
i think this is not a seperate issue but it is on same line.
the above resolution just solved a partial query.
Hope this is fine.
Let me know your input for resolving my query.
thanks,
Rishit Shah
Created 07-10-2017 04:54 AM
Does the query fail while running select query? Seems to be related to HIVE-13877.
Created 07-10-2017 09:14 AM
Yes it fails with select queries.
i checked above that but i dont know how to make us of the patch?
thanks,
Rishit Shah