Unable to insert data due to noexec flag on /tmp directory
Condition
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
org.xerial.snappy.Snappy
.
Cause
While inserting data into a Hive table through a Beeline query, the insert
operation can fail with the following
error:
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
the noexec
mount option is set on /tmp,
the compiler fails to initialize.