背景
使用impala对大数据量进行处理时出现如下错误
Create file /tmp/impala-scratch/XXX failed with errno=2 description=Error(2): No such file or directory
原因
查资料发现impala在大数据量处理时会用到磁盘保存中间数据
By default, intermediate files used during large sort, join, aggregation, or analytic function operations are stored in the directory /tmp/impala-scratch. These files are removed when the operation finishes. (Multiple concurrent queries can perform operations that use the “spill to disk” technique, without any name conflicts for these temporary files.) You can specify a different location by starting the impalad daemon with the --scratch_dirs=“path_to_directory” configuration option or the equivalent configuration option in the Cloudera Manager user interface. You can specify a single directory, or a comma-separated list of directories. The scratch directories must be on the local filesystem, not in HDFS. You might sp