Currently we use Hive 0.12 and the behavior is different between Hive CLI and Hive BEELINE in regards to how hive scratchdir is created/used. Hive CLI picks up the value defined by hive-exec.scratchdir parameter in hive-site.xml where Hive BEELINE uses a static value of /tmp/hive-hive. The static nature of BEELINE causes issues as /tmp/hive-hive is created automatically and is owned by the user who executed the very first query preventing write access for all other users of BEELINE. I filed a case with Hortonworks and as per them this behavior is fixed in Hive 0.14.
To fix this issue in Hive 0.12:
Create a top level directory /tmp/hive-hive
Change owner to hive:hive and make it world read/writable. Users submitting their queries through beeline will still have a subdir under top level directory and it will be owned by them. The subdir will be in the form of hive_yyyy_mm_dd_hh_mm_ss_999_999999999. Also these subdirs will be removed automatically. Multiple users won't be able to view each others temporary output.
Note: Beeline uses HiveServer2 and HiveServer2 has a bug as per Hive-6847
Currently we use Hive 0.12 and the behavior is different between Hive CLI and Hive BEELINE in regards to how
hive scratchdir
is created/used. Hive CLI picks up the value defined byhive-exec.scratchdir
parameter inhive-site.xml
where Hive BEELINE uses a static value of/tmp/hive-hive
. The static nature of BEELINE causes issues as/tmp/hive-hive
is created automatically and is owned by the user who executed the very first query preventing write access for all other users of BEELINE. I filed a case with Hortonworks and as per them this behavior is fixed in Hive 0.14. To fix this issue in Hive 0.12:/tmp/hive-hive
hive_yyyy_mm_dd_hh_mm_ss_999_999999999
. Also these subdirs will be removed automatically. Multiple users won't be able to view each others temporary output.Note: Beeline uses HiveServer2 and HiveServer2 has a bug as per Hive-6847