diff --git a/ql/src/java/org/apache/hadoop/hive/ql/io/CombineHiveRecordReader.java b/ql/src/java/org/apache/hadoop/hive/ql/io/CombineHiveRecordReader.java index 0d2eb0a0a9..59f835b260 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/io/CombineHiveRecordReader.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/io/CombineHiveRecordReader.java @@ -26,6 +26,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hive.common.JavaUtils; import org.apache.hadoop.hive.conf.HiveConf; +import org.apache.hadoop.hive.llap.io.api.LlapProxy; import org.apache.hadoop.hive.ql.exec.Utilities; import org.apache.hadoop.hive.ql.exec.mr.ExecMapper; import org.apache.hadoop.hive.ql.io.CombineHiveInputFormat.CombineHiveInputSplit; @@ -69,25 +70,22 @@ public CombineHiveRecordReader(InputSplit split, Configuration conf, + inputFormatClassName); } InputFormat inputFormat = HiveInputFormat.getInputFormatFromCache(inputFormatClass, jobConf); - try { - // TODO: refactor this out - if (pathToPartInfo == null) { - MapWork mrwork; - if (HiveConf.getVar(conf, HiveConf.ConfVars.HIVE_EXECUTION_ENGINE).equals("tez")) { - mrwork = (MapWork) Utilities.getMergeWork(jobConf); + if (HiveConf.getBoolVar(conf, HiveConf.ConfVars.LLAP_IO_ENABLED, LlapProxy.isDaemon())) { + try { + // TODO: refactor this out + if (pathToPartInfo == null) { + MapWork mrwork = (MapWork) Utilities.getMergeWork(jobConf); if (mrwork == null) { mrwork = Utilities.getMapWork(jobConf); } - } else { - mrwork = Utilities.getMapWork(jobConf); + pathToPartInfo = mrwork.getPathToPartitionInfo(); } - pathToPartInfo = mrwork.getPathToPartitionInfo(); - } - PartitionDesc part = extractSinglePartSpec(hsplit); - inputFormat = HiveInputFormat.wrapForLlap(inputFormat, jobConf, part); - } catch (HiveException e) { - throw new IOException(e); + PartitionDesc part = extractSinglePartSpec(hsplit); + inputFormat = HiveInputFormat.wrapForLlap(inputFormat, jobConf, part); + } catch (HiveException e) { + throw new IOException(e); + } } // create a split for the given partition diff --git a/ql/src/java/org/apache/hadoop/hive/ql/io/HiveInputFormat.java b/ql/src/java/org/apache/hadoop/hive/ql/io/HiveInputFormat.java index c97c961481..a044f22b37 100755 --- a/ql/src/java/org/apache/hadoop/hive/ql/io/HiveInputFormat.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/io/HiveInputFormat.java @@ -233,9 +233,6 @@ public void configure(JobConf job) { public static InputFormat wrapForLlap( InputFormat inputFormat, Configuration conf, PartitionDesc part) throws HiveException { - if (!HiveConf.getBoolVar(conf, ConfVars.LLAP_IO_ENABLED, LlapProxy.isDaemon())) { - return inputFormat; // LLAP not enabled, no-op. - } String ifName = inputFormat.getClass().getCanonicalName(); boolean isSupported = inputFormat instanceof LlapWrappableInputFormatInterface; boolean isCacheOnly = inputFormat instanceof LlapCacheOnlyInputFormatInterface; @@ -406,10 +403,12 @@ public RecordReader getRecordReader(InputSplit split, JobConf job, pushProjectionsAndFilters(job, inputFormatClass, splitPath, nonNative); InputFormat inputFormat = getInputFormatFromCache(inputFormatClass, job); - try { - inputFormat = HiveInputFormat.wrapForLlap(inputFormat, job, part); - } catch (HiveException e) { - throw new IOException(e); + if (HiveConf.getBoolVar(job, ConfVars.LLAP_IO_ENABLED, LlapProxy.isDaemon())) { + try { + inputFormat = HiveInputFormat.wrapForLlap(inputFormat, job, part); + } catch (HiveException e) { + throw new IOException(e); + } } RecordReader innerReader = null; try {