Support Questions
Find answers, ask questions, and share your expertise

Hive LLAP: Unable to load native library(*.so) in hiveserver2.

Highlighted

Hive LLAP: Unable to load native library(*.so) in hiveserver2.

Explorer

Hi All,

I'm executing a custom Hive UDF, which internally loads a native library 'mynative.so'.

so the custom UDF is working fine with Hive but not with HiveLLAP, getting an exception "no mynative in java.library.path".

Following are the hive properties set on Ambari: -

custhive.jar: - Is a custom jar consist of custom Hive UDF's.

jlib.jar: - It has been called by a custom hive UDF's, it furthers load mynative.so file.

/opt/rack/7.0.2.2/jlib/lib/: - This directory path contains java jar & mynative.so library.

/opt/rack/7.0.2.2/custhive/lib/: - This directory path contains custhive.jar.

Flow of loading a native library:-

custhive===calls==>jlib.jar====load===>mynative.so

Hive Property Protegrity configuration set.
Advance hive-env template

#Add custhive.jar to HIVE_CLASSPATH

export JAVA_LIBRARY_PATH=${JAVA_LIBRARY_PATH}:/opt/rack/7.0.2.2/jlib/lib/

export HIVE_CLASSPATH=${HIVE_CLASSPATH}:/opt/rack/7.0.2.2/custhive/lib/*:/opt/rack/7.0.2.2/jlib/lib/

Auxillary JAR list /opt/rack/7.0.2.2/custhive/lib/custhive.jar,/opt/rack/7.0.2.2/jlib/lib/jlib.jar
hive-interactive-env template

#Add custhive.jar to HIVE_CLASSPATH

export JAVA_LIBRARY_PATH=/opt/rack/7.0.2.2/jlib/lib/

export LD_LIBRARY_PATH=/opt/rack/7.0.2.2/jlib/lib/

export HIVE_CLASSPATH=${HIVE_CLASSPATH}:/opt/rack/7.0.2.2/custhive/lib/*:/opt/rack/7.0.2.2/jlib/lib/*

@Ali Bajwa: Seeking your inputs!

1 REPLY 1

Re: Hive LLAP: Unable to load native library(*.so) in hiveserver2.

Contributor

I don't think classpath modification for LLAP to add local paths is currently supported, although I can see how it could be a useful feature.

Is it possible in your case to package the native library as part of the package, adding it to the aux jars? Aux jars don't actually have to be jars, they can be any files - the name is a legacy name.