Search in sources :

Example 1 with QueryResultsCache

use of org.apache.hadoop.hive.ql.cache.results.QueryResultsCache in project hive by apache.

the class SemanticAnalyzer method getDestinationFilePath.

private Path getDestinationFilePath(final String destinationFile, boolean isMmTable) {
    if (this.isResultsCacheEnabled() && this.queryTypeCanUseCache()) {
        assert (!isMmTable);
        QueryResultsCache instance = QueryResultsCache.getInstance();
        // QueryResultsCache should have been initialized by now
        if (instance != null) {
            Path resultCacheTopDir = instance.getCacheDirPath();
            String dirName = UUID.randomUUID().toString();
            Path resultDir = new Path(resultCacheTopDir, dirName);
            this.ctx.setFsResultCacheDirs(resultDir);
            return resultDir;
        }
    }
    return new Path(destinationFile);
}
Also used : Path(org.apache.hadoop.fs.Path) QueryResultsCache(org.apache.hadoop.hive.ql.cache.results.QueryResultsCache)

Aggregations

Path (org.apache.hadoop.fs.Path)1 QueryResultsCache (org.apache.hadoop.hive.ql.cache.results.QueryResultsCache)1