Unable to insert data due to noexec flag on /tmp directory
If you are running an environment in which the /tmp directory is
mounted with the
noexec option, Hive table insertion fails stating
that the Tez compiler could not initialize class
Error: Error while compiling statement: FAILED: Execution Error, return code -101 from org.apache.hadoop.hive.ql.exec.tez.TezTask. Could not initialize class org.xerial.snappy.Snappy (state=08S01,code=-101)
The error occurs when the /tmp directory is mounted with the
noexec option. The
noexec mount option is
used as an enhanced security measure to prevent running of binaries from the
/tmp directory. However, Hive refers to the
/tmp library path to access the Snappy JARs and since
noexec mount option is set on /tmp,
the compiler fails to initialize.
- Log in to Cloudera Manager as an administrator.
hiveserver2_java_optsproperty. and search for the
Specify a temporary directory other than /tmp, for
example, /opt/tmp by appending the following in
Search for the
hive.exec.local.scratchdirproperty and set the value to /opt/tmp.
- Click Save Changes
- Before you restart the Hive on Tez service, ensure that the temporary directory (/opt/tmp) that you specified is present in all the hosts and the Hive user has access to this directory.
- Restart the Hive on Tez service for the changes to apply.