Hi,

Yes you can compile it into a jar, and insert the command line "java
> /xxx/my.jar" into Hive queries.
>

I think it needs to be "java -jar /xxx/my.jar", and this only works if
/xxx/my.jar is
already present on every node in the cluster. Otherwise, you need to add the

jar to the distributed cache using "add FILE /xxx/my.jar", and then
reference
it in your query as "java -jar my.jar".

Note that if you add the jar file using "add JAR /xxx/my.jar" it will end up
in the
libjars subdirectory of the jobcache, which is not the current working
directory
of the process that is spawned to run your script, so you'll have a hard
time
referencing it by path. You'll also have a hard time referencing it by
classname
since it is not added to the CLASSPATH of the spawned process.
HIVE-928 is intended to address this issue.

Thanks.

Carl

Reply via email to