通过spark-sql、hive-sql、hue等提交select或者insert overwrite等sql到hive时,会产生该目录,用于临时存放执行结果,比如insert overwrite会将结果暂存到该目录下,待任务结束,将结果复制到hive表中。
关于该目录的生成位置策略可参考该文章:https://blog.csdn.net/zhoudetiankong/article/details/51800887,文章中提到了可修改该目录的生成位置,复述如下:
默认配置:
<property>
<name>hive.exec.stagingdir</name>
</property>
修改后:
<property>
<name>hive.exec.stagingdir</name>
<value>/tmp/hive/.hive-staging</value>
</property>
https://issues.apache.org/jira/browse/SPARK-1837
https://www.aboutyun.com//forum.php/?mod=viewthread&tid=20657&extra=page%3D1&page=1&