hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ser...@apache.org
Subject [2/2] hive git commit: HIVE-12950 : get rid of the NullScan emptyFile madness (Sergey Shelukhin, reviewed by Ashutosh Chauhan)
Date Mon, 08 Feb 2016 23:24:45 GMT
HIVE-12950 : get rid of the NullScan emptyFile madness (Sergey Shelukhin, reviewed by Ashutosh Chauhan)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/8787b3dd
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/8787b3dd
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/8787b3dd

Branch: refs/heads/master
Commit: 8787b3ddd94d13fa494271ac2e6b3fde0500c791
Parents: 6d5dc43
Author: Sergey Shelukhin <sershe@apache.org>
Authored: Mon Feb 8 15:24:11 2016 -0800
Committer: Sergey Shelukhin <sershe@apache.org>
Committed: Mon Feb 8 15:24:11 2016 -0800

----------------------------------------------------------------------
 .../test/resources/testconfiguration.properties |   6 +-
 .../apache/hadoop/hive/ql/exec/MapOperator.java |   2 +-
 .../apache/hadoop/hive/ql/exec/Operator.java    |   4 +-
 .../hadoop/hive/ql/exec/ScriptOperator.java     |   4 +-
 .../apache/hadoop/hive/ql/exec/Utilities.java   |   5 +-
 .../hadoop/hive/ql/exec/tez/DagUtils.java       |   7 +-
 .../hadoop/hive/ql/exec/tez/SplitGrouper.java   |   5 +-
 .../ql/exec/vector/VectorGroupByOperator.java   |   1 -
 .../hadoop/hive/ql/io/HiveFileFormatUtils.java  |   8 +-
 .../hadoop/hive/ql/io/HiveInputFormat.java      |   4 +-
 .../hadoop/hive/ql/io/NullRowsInputFormat.java  | 130 ++++--
 .../hadoop/hive/ql/io/NullScanFileSystem.java   | 116 +++++
 .../hive/ql/io/OneNullRowInputFormat.java       |  21 +-
 .../hive/ql/optimizer/physical/LlapDecider.java |  16 +-
 .../physical/NullScanTaskDispatcher.java        |  15 +-
 .../apache/hadoop/hive/ql/plan/BaseWork.java    |   2 +-
 .../org/apache/hadoop/hive/ql/plan/MapWork.java |  10 -
 .../services/org.apache.hadoop.fs.FileSystem    |  14 +
 .../test/queries/clientpositive/llap_nullscan.q |  30 ++
 .../clientpositive/llap/llap_nullscan.q.out     | 464 +++++++++++++++++++
 .../results/clientpositive/metadataonly1.q.out  |  84 ++--
 .../clientpositive/optimize_nullscan.q.out      | 216 ++++-----
 .../spark/optimize_nullscan.q.out               |  90 ++--
 .../clientpositive/tez/llap_nullscan.q.out      | 462 ++++++++++++++++++
 .../clientpositive/tez/metadataonly1.q.out      |  72 +--
 .../clientpositive/tez/optimize_nullscan.q.out  |  90 ++--
 .../hive/ql/exec/vector/VectorizedRowBatch.java |   4 +-
 27 files changed, 1509 insertions(+), 373 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/8787b3dd/itests/src/test/resources/testconfiguration.properties
----------------------------------------------------------------------
diff --git a/itests/src/test/resources/testconfiguration.properties b/itests/src/test/resources/testconfiguration.properties
index b46b160..cbb9743 100644
--- a/itests/src/test/resources/testconfiguration.properties
+++ b/itests/src/test/resources/testconfiguration.properties
@@ -389,10 +389,11 @@ minitez.query.files=bucket_map_join_tez1.q,\
   explainuser_4.q,\
   hybridgrace_hashjoin_1.q,\
   hybridgrace_hashjoin_2.q,\
+  llap_nullscan.q,\
+  llapdecider.q,\
+  lvj_mapjoin.q,\
   mapjoin_decimal.q,\
   mergejoin_3way.q,\
-  lvj_mapjoin.q,\
-  llapdecider.q,\
   mrr.q,\
   orc_ppd_basic.q,\
   orc_merge_diff_fs.q,\
@@ -443,6 +444,7 @@ minillap.query.files=bucket_map_join_tez1.q,\
   mapjoin_decimal.q,\
   lvj_mapjoin.q,\
   llapdecider.q,\
+  llap_nullscan.q,\
   mrr.q,\
   orc_ppd_basic.q,\
   tez_bmj_schema_evolution.q,\

http://git-wip-us.apache.org/repos/asf/hive/blob/8787b3dd/ql/src/java/org/apache/hadoop/hive/ql/exec/MapOperator.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/MapOperator.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/MapOperator.java
index 2b690f8..4608f70 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/MapOperator.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/MapOperator.java
@@ -529,7 +529,7 @@ public class MapOperator extends Operator<MapWork> implements Serializable, Clon
     for (Entry<Operator<?>, MapOpCtx> entry : contexts.entrySet()) {
       Operator<?> operator = entry.getKey();
       MapOpCtx context = entry.getValue();
-      operator.setInputContext(nominalPath, context.tableName, context.partName);
+      operator.setInputContext(context.tableName, context.partName);
     }
     currentCtxs = contexts.values().toArray(new MapOpCtx[contexts.size()]);
   }

http://git-wip-us.apache.org/repos/asf/hive/blob/8787b3dd/ql/src/java/org/apache/hadoop/hive/ql/exec/Operator.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/Operator.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/Operator.java
index dbe4f80..571620e 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/Operator.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/Operator.java
@@ -1083,11 +1083,11 @@ public abstract class Operator<T extends OperatorDesc> implements Serializable,C
   }
 
   // called by map operator. propagated recursively to single parented descendants
-  public void setInputContext(String inputPath, String tableName, String partitionName) {
+  public void setInputContext(String tableName, String partitionName) {
     if (childOperators != null) {
       for (Operator<? extends OperatorDesc> child : childOperators) {
         if (child.getNumParent() == 1) {
-          child.setInputContext(inputPath, tableName, partitionName);
+          child.setInputContext(tableName, partitionName);
         }
       }
     }

http://git-wip-us.apache.org/repos/asf/hive/blob/8787b3dd/ql/src/java/org/apache/hadoop/hive/ql/exec/ScriptOperator.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/ScriptOperator.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/ScriptOperator.java
index 9f311a4..2bce5d0 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/ScriptOperator.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/ScriptOperator.java
@@ -330,10 +330,10 @@ public class ScriptOperator extends Operator<ScriptDesc> implements
   private transient String partitionName ;
 
   @Override
-  public void setInputContext(String inputPath, String tableName, String partitionName) {
+  public void setInputContext(String tableName, String partitionName) {
     this.tableName = tableName;
     this.partitionName = partitionName;
-    super.setInputContext(inputPath, tableName, partitionName);
+    super.setInputContext(tableName, partitionName);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/8787b3dd/ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java
index 5e0553d..bf916f5 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java
@@ -2917,10 +2917,7 @@ public final class Utilities {
   public static List<Path> getInputPathsTez(JobConf job, MapWork work) throws Exception {
     String scratchDir = job.get(DagUtils.TEZ_TMP_DIR_KEY);
 
-    // we usually don't want to create dummy files for tez, however the metadata only
-    // optimization relies on it.
-    List<Path> paths = getInputPaths(job, work, new Path(scratchDir), null,
-        !work.isUseOneNullRowInputFormat());
+    List<Path> paths = getInputPaths(job, work, new Path(scratchDir), null, true);
 
     return paths;
   }

http://git-wip-us.apache.org/repos/asf/hive/blob/8787b3dd/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java
index a1b7445..39866a3 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java
@@ -224,10 +224,6 @@ public class DagUtils {
       inpFormat = BucketizedHiveInputFormat.class.getName();
     }
 
-    if (mapWork.isUseOneNullRowInputFormat()) {
-      inpFormat = CombineHiveInputFormat.class.getName();
-    }
-
     if (mapWork.getDummyTableScan()) {
       // hive input format doesn't handle the special condition of no paths + 1
       // split correctly.
@@ -599,8 +595,7 @@ public class DagUtils {
 
     // remember mapping of plan to input
     conf.set(Utilities.INPUT_NAME, mapWork.getName());
-    if (HiveConf.getBoolVar(conf, ConfVars.HIVE_AM_SPLIT_GENERATION)
-        && !mapWork.isUseOneNullRowInputFormat()) {
+    if (HiveConf.getBoolVar(conf, ConfVars.HIVE_AM_SPLIT_GENERATION)) {
 
       // set up the operator plan. (before setting up splits on the AM)
       Utilities.setMapWork(conf, mapWork, mrScratchDir, false);

http://git-wip-us.apache.org/repos/asf/hive/blob/8787b3dd/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/SplitGrouper.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/SplitGrouper.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/SplitGrouper.java
index f4496df..b678884 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/SplitGrouper.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/SplitGrouper.java
@@ -275,9 +275,8 @@ public class SplitGrouper {
                                        MapWork work) throws IOException {
     boolean retval = false;
     Path path = ((FileSplit) s).getPath();
-    PartitionDesc pd =
-        HiveFileFormatUtils.getPartitionDescFromPathRecursively(work.getPathToPartitionInfo(),
-            path, cache);
+    PartitionDesc pd = HiveFileFormatUtils.getPartitionDescFromPathRecursively(
+        work.getPathToPartitionInfo(), path, cache);
     String currentDeserializerClass = pd.getDeserializerClassName();
     Class<?> currentInputFormatClass = pd.getInputFileFormatClass();
 

http://git-wip-us.apache.org/repos/asf/hive/blob/8787b3dd/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorGroupByOperator.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorGroupByOperator.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorGroupByOperator.java
index b7ce309..b8490df 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorGroupByOperator.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorGroupByOperator.java
@@ -883,7 +883,6 @@ public class VectorGroupByOperator extends Operator<GroupByDesc> implements
   @Override
   public void process(Object row, int tag) throws HiveException {
     VectorizedRowBatch batch = (VectorizedRowBatch) row;
-
     if (batch.size > 0) {
       processingMode.processBatch(batch);
     }

http://git-wip-us.apache.org/repos/asf/hive/blob/8787b3dd/ql/src/java/org/apache/hadoop/hive/ql/io/HiveFileFormatUtils.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/io/HiveFileFormatUtils.java b/ql/src/java/org/apache/hadoop/hive/ql/io/HiveFileFormatUtils.java
index 8b229af..6bb5efa 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/io/HiveFileFormatUtils.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/io/HiveFileFormatUtils.java
@@ -365,12 +365,8 @@ public final class HiveFileFormatUtils {
 
     if (part == null
         && (ignoreSchema
-            || (dir.toUri().getScheme() == null || dir.toUri().getScheme().trim()
-            .equals(""))
-            || pathsContainNoScheme(pathToPartitionInfo)
-            )
-
-        ) {
+            || (dir.toUri().getScheme() == null || dir.toUri().getScheme().trim().equals(""))
+            || pathsContainNoScheme(pathToPartitionInfo))) {
 
       Map<String, PartitionDesc> newPathToPartitionInfo = null;
       if (cacheMap != null) {

http://git-wip-us.apache.org/repos/asf/hive/blob/8787b3dd/ql/src/java/org/apache/hadoop/hive/ql/io/HiveInputFormat.java
----------------------------------------------------------------------
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 14a6a72..1ed9b9c 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
@@ -128,7 +128,7 @@ public class HiveInputFormat<K extends WritableComparable, V extends Writable>
       if (inputSplit instanceof FileSplit) {
         return ((FileSplit) inputSplit).getPath();
       }
-      return new Path("");
+      throw new RuntimeException(inputSplit + " is not a FileSplit");
     }
 
     /** The position of the first byte in the file to process. */
@@ -282,7 +282,7 @@ public class HiveInputFormat<K extends WritableComparable, V extends Writable>
       throw new IOException("cannot find class " + inputFormatClassName, e);
     }
 
-    if (this.mrwork == null) {
+    if (this.mrwork == null || pathToPartitionInfo == null) {
       init(job);
     }
 

http://git-wip-us.apache.org/repos/asf/hive/blob/8787b3dd/ql/src/java/org/apache/hadoop/hive/ql/io/NullRowsInputFormat.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/io/NullRowsInputFormat.java b/ql/src/java/org/apache/hadoop/hive/ql/io/NullRowsInputFormat.java
index 9638f2a..c53d149 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/io/NullRowsInputFormat.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/io/NullRowsInputFormat.java
@@ -18,59 +18,81 @@
 
 package org.apache.hadoop.hive.ql.io;
 
-import java.io.DataInput;
-import java.io.DataOutput;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hive.ql.exec.vector.ColumnVector;
+import org.apache.hadoop.hive.ql.exec.vector.VectorizedInputFormatInterface;
+import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch;
+import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatchCtx;
+
+import org.apache.hadoop.hive.ql.exec.Utilities;
+
 import java.io.IOException;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.apache.hadoop.io.NullWritable;
+import org.apache.hadoop.mapred.FileSplit;
 import org.apache.hadoop.mapred.InputFormat;
 import org.apache.hadoop.mapred.InputSplit;
 import org.apache.hadoop.mapred.JobConf;
 import org.apache.hadoop.mapred.JobConfigurable;
 import org.apache.hadoop.mapred.RecordReader;
 import org.apache.hadoop.mapred.Reporter;
+import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
 
 /**
  * NullRowsInputFormat outputs null rows, maximum 100.
  */
 public class NullRowsInputFormat implements InputFormat<NullWritable, NullWritable>,
-    JobConfigurable {
+    JobConfigurable, VectorizedInputFormatInterface {
 
   static final int MAX_ROW = 100; // to prevent infinite loop
   static final Logger LOG = LoggerFactory.getLogger(NullRowsRecordReader.class.getName());
 
-  public static class DummyInputSplit implements InputSplit {
-    public DummyInputSplit() {
+  public static class DummyInputSplit extends FileSplit {
+    @SuppressWarnings("unused")  // Serialization ctor.
+    private DummyInputSplit() {
+      super();
     }
 
-    @Override
-    public long getLength() throws IOException {
-      return 1;
+    public DummyInputSplit(String path) {
+      super(new Path(path, "null"), 0, 1, (String[])null);
     }
-
-    @Override
-    public String[] getLocations() throws IOException {
-      return new String[0];
-    }
-
-    @Override
-    public void readFields(DataInput arg0) throws IOException {
-    }
-
-    @Override
-    public void write(DataOutput arg0) throws IOException {
-    }
-
   }
 
-  public static class NullRowsRecordReader implements RecordReader<NullWritable, NullWritable> {
 
-    private int counter;
+  @SuppressWarnings("rawtypes")
+  public static class NullRowsRecordReader implements RecordReader {
 
-    public NullRowsRecordReader() {
+    private int counter;
+    protected final VectorizedRowBatchCtx rbCtx;
+    private final boolean[] columnsToIncludeTruncated;
+    private final Object[] partitionValues;
+    private boolean addPartitionCols = true;
+
+    public NullRowsRecordReader(Configuration conf, InputSplit split) throws IOException {
+      boolean isVectorMode = Utilities.isVectorMode(conf);
+      if (LOG.isDebugEnabled()) {
+        LOG.debug("Null record reader in " + (isVectorMode ? "" : "non-") + "vector mode");
+      }
+      if (isVectorMode) {
+        rbCtx = Utilities.getVectorizedRowBatchCtx(conf);
+        columnsToIncludeTruncated = rbCtx.getColumnsToIncludeTruncated(conf);
+        int partitionColumnCount = rbCtx.getPartitionColumnCount();
+        if (partitionColumnCount > 0) {
+          partitionValues = new Object[partitionColumnCount];
+          VectorizedRowBatchCtx.getPartitionValues(rbCtx, conf, (FileSplit)split, partitionValues);
+        } else {
+          partitionValues = null;
+        }
+      } else {
+        rbCtx = null;
+        columnsToIncludeTruncated = null;
+        partitionValues = null;
+      }
     }
+
     @Override
     public void close() throws IOException {
     }
@@ -81,8 +103,9 @@ public class NullRowsInputFormat implements InputFormat<NullWritable, NullWritab
     }
 
     @Override
-    public NullWritable createValue() {
-      return NullWritable.get();
+    public Object createValue() {
+      return rbCtx == null ? NullWritable.get() :
+        rbCtx.createVectorizedRowBatch(columnsToIncludeTruncated);
     }
 
     @Override
@@ -96,26 +119,59 @@ public class NullRowsInputFormat implements InputFormat<NullWritable, NullWritab
     }
 
     @Override
-    public boolean next(NullWritable arg0, NullWritable arg1) throws IOException {
-      if (counter++ < MAX_ROW) {
+    public boolean next(Object arg0, Object value) throws IOException {
+      if (rbCtx != null) {
+        if (counter >= MAX_ROW) return false;
+        makeNullVrb(value, MAX_ROW);
+        counter = MAX_ROW;
+        return true;
+      } else if (counter++ < MAX_ROW) {
         return true;
       }
       return false;
     }
+
+    protected void makeNullVrb(Object value, int size) {
+      VectorizedRowBatch vrb = (VectorizedRowBatch)value;
+      if (addPartitionCols) {
+        if (partitionValues != null) {
+          rbCtx.addPartitionColsToBatch(vrb, partitionValues);
+        }
+        addPartitionCols = false;
+      }
+
+      vrb.size = size;
+      vrb.selectedInUse = false;
+      for (int i = 0; i < rbCtx.getDataColumnCount(); i++) {
+        if (columnsToIncludeTruncated != null
+            && (columnsToIncludeTruncated.length <= i || !columnsToIncludeTruncated[i])) {
+          continue;
+        }
+        ColumnVector cv = vrb.cols[i];
+        cv.noNulls = false;
+        cv.isRepeating = true;
+        cv.isNull[0] = true;
+      }
+    }
   }
 
+  @SuppressWarnings("unchecked")
   @Override
-  public RecordReader<NullWritable, NullWritable> getRecordReader(InputSplit arg0,
-      JobConf arg1, Reporter arg2) throws IOException {
-    return new NullRowsRecordReader();
+  public RecordReader<NullWritable, NullWritable> getRecordReader(InputSplit split,
+      JobConf conf, Reporter arg2) throws IOException {
+    return new NullRowsRecordReader(conf, split);
   }
 
   @Override
-  public InputSplit[] getSplits(JobConf arg0, int arg1) throws IOException {
-    InputSplit[] ret = new InputSplit[1];
-    ret[0] = new DummyInputSplit();
-    LOG.info("Calculating splits");
-    return ret;
+  public InputSplit[] getSplits(JobConf conf, int arg1) throws IOException {
+    // It's important to read the correct nulls! (in truth, the path is needed for SplitGrouper).
+    String[] paths = conf.getTrimmedStrings(FileInputFormat.INPUT_DIR, (String[])null);
+    if (paths == null) throw new IOException("Cannot find path in conf");
+    InputSplit[] result = new InputSplit[paths.length];
+    for (int i = 0; i < paths.length; ++i) {
+      result[i] = new DummyInputSplit(paths[i]);
+    }
+    return result;
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/8787b3dd/ql/src/java/org/apache/hadoop/hive/ql/io/NullScanFileSystem.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/io/NullScanFileSystem.java b/ql/src/java/org/apache/hadoop/hive/ql/io/NullScanFileSystem.java
new file mode 100644
index 0000000..88e9445
--- /dev/null
+++ b/ql/src/java/org/apache/hadoop/hive/ql/io/NullScanFileSystem.java
@@ -0,0 +1,116 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.hive.ql.io;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import org.apache.hadoop.fs.FSDataInputStream;
+import org.apache.hadoop.fs.FSDataOutputStream;
+import org.apache.hadoop.fs.FileStatus;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.fs.permission.FsPermission;
+import org.apache.hadoop.util.Progressable;
+
+/**
+ * The bogus filesystem that makes Hive not read files for nullscans via lies and deceit.
+ * Relies on the fact that the input format doesn't actually have to touch the file.
+ * Add method implementations if really needed.
+ */
+public class NullScanFileSystem extends FileSystem {
+  public static String getBase() {
+    return getBaseScheme() + "://null/";
+  }
+
+  public static String getBaseScheme() {
+    return "nullscan";
+  }
+
+  public NullScanFileSystem() {
+  }
+
+  @Override
+  public String getScheme() {
+    return getBaseScheme();
+  }
+
+  @Override
+  public URI getUri() {
+    try {
+      return new URI(getBase());
+    } catch (URISyntaxException e) {
+      throw new RuntimeException(e);
+    }
+  }
+
+  @Override
+  public FSDataInputStream open(Path f, int bufferSize) throws IOException {
+    throw new UnsupportedOperationException("Not supported");
+  }
+
+  @Override
+  public FSDataOutputStream create(Path f, FsPermission permission,
+      boolean overwrite, int bufferSize, short replication, long blockSize,
+      Progressable progress) throws IOException {
+    throw new UnsupportedOperationException("Not supported");
+  }
+
+  @Override
+  public FSDataOutputStream append(Path f, int bufferSize,
+      Progressable progress) throws IOException {
+    throw new UnsupportedOperationException("Not supported");
+  }
+
+  @Override
+  public boolean rename(Path src, Path dst) throws IOException {
+    return true;
+  }
+
+  @Override
+  public boolean delete(Path f, boolean recursive) throws IOException {
+    throw new UnsupportedOperationException("Not supported");
+  }
+
+  @Override
+  public FileStatus[] listStatus(Path f) throws FileNotFoundException, IOException {
+    return new FileStatus[] { new FileStatus(0, false, 0, 0, 0, new Path(f, "null")) };
+  }
+
+  @Override
+  public void setWorkingDirectory(Path new_dir) {
+  }
+
+  @Override
+  public Path getWorkingDirectory() {
+    return new Path(getBase());
+  }
+
+  @Override
+  public boolean mkdirs(Path f, FsPermission permission) throws IOException {
+    throw new UnsupportedOperationException("Not supported");
+  }
+
+  @Override
+  public FileStatus getFileStatus(Path f) throws IOException {
+    return new FileStatus(0, false, 0, 0, 0, f);
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/8787b3dd/ql/src/java/org/apache/hadoop/hive/ql/io/OneNullRowInputFormat.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/io/OneNullRowInputFormat.java b/ql/src/java/org/apache/hadoop/hive/ql/io/OneNullRowInputFormat.java
index 91a6d5a..01f48e4 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/io/OneNullRowInputFormat.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/io/OneNullRowInputFormat.java
@@ -20,6 +20,8 @@ package org.apache.hadoop.hive.ql.io;
 
 import java.io.IOException;
 
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hive.ql.exec.vector.VectorizedInputFormatInterface;
 import org.apache.hadoop.io.NullWritable;
 import org.apache.hadoop.mapred.InputSplit;
 import org.apache.hadoop.mapred.JobConf;
@@ -31,15 +33,21 @@ import org.apache.hadoop.mapred.Reporter;
  * metadata only queries.
  *
  */
-public class OneNullRowInputFormat extends NullRowsInputFormat {
+public class OneNullRowInputFormat extends NullRowsInputFormat
+  implements VectorizedInputFormatInterface {
 
+  @SuppressWarnings("unchecked")
   @Override
-  public RecordReader<NullWritable, NullWritable> getRecordReader(InputSplit arg0,
-      JobConf arg1, Reporter arg2) throws IOException {
-    return new OneNullRowRecordReader();
+  public RecordReader<NullWritable, NullWritable> getRecordReader(InputSplit split,
+      JobConf conf, Reporter arg2) throws IOException {
+    return new OneNullRowRecordReader(conf, split);
   }
 
   public static class OneNullRowRecordReader extends NullRowsRecordReader {
+    public OneNullRowRecordReader(Configuration conf, InputSplit split) throws IOException {
+      super(conf, split);
+    }
+
     private boolean processed;
 
     @Override
@@ -53,11 +61,14 @@ public class OneNullRowInputFormat extends NullRowsInputFormat {
     }
 
     @Override
-    public boolean next(NullWritable key, NullWritable value) throws IOException {
+    public boolean next(Object key, Object value) throws IOException {
       if (processed) {
         return false;
       }
       processed = true;
+      if (rbCtx != null) {
+        makeNullVrb(value, 1);
+      }
       return true;
     }
   }

http://git-wip-us.apache.org/repos/asf/hive/blob/8787b3dd/ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/LlapDecider.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/LlapDecider.java b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/LlapDecider.java
index ae64749..b62f6a7 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/LlapDecider.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/LlapDecider.java
@@ -134,12 +134,12 @@ public class LlapDecider implements PhysicalPlanResolver {
       throws SemanticException {
 
       if (HiveConf.getBoolVar(conf, HiveConf.ConfVars.LLAP_AUTO_ALLOW_UBER)) {
-	// let's see if we can go one step further and just uber this puppy
-	if (tezWork.getChildren(work).isEmpty()
-	    && work instanceof ReduceWork
-	    && ((ReduceWork) work).getNumReduceTasks() == 1) {
-	  work.setUberMode(true);
-	}
+        // let's see if we can go one step further and just uber this puppy
+        if (tezWork.getChildren(work).isEmpty()
+            && work instanceof ReduceWork
+            && ((ReduceWork) work).getNumReduceTasks() == 1) {
+          work.setUberMode(true);
+        }
       }
 
       // always mark as llap
@@ -158,10 +158,10 @@ public class LlapDecider implements PhysicalPlanResolver {
 
       // first we check if we *can* run in llap. If we need to use
       // user code to do so (script/udf) we don't.
-      if (work instanceof MapWork && ((MapWork)work).isUseOneNullRowInputFormat()) {
+      /*if (work instanceof MapWork && ((MapWork)work).isUseOneNullRowInputFormat()) {
         // LLAP doesn't support file-based splits that this forces.
         return false;
-      }
+      }*/
 
       if (!evaluateOperators(work)) {
         LOG.info("some operators cannot be run in llap");

http://git-wip-us.apache.org/repos/asf/hive/blob/8787b3dd/ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/NullScanTaskDispatcher.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/NullScanTaskDispatcher.java b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/NullScanTaskDispatcher.java
index 0c4519c..0b82596 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/NullScanTaskDispatcher.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/NullScanTaskDispatcher.java
@@ -27,6 +27,7 @@ import java.util.HashSet;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.ServiceLoader;
 import java.util.Map.Entry;
 import java.util.Stack;
 
@@ -37,6 +38,7 @@ import org.apache.hadoop.hive.ql.exec.Operator;
 import org.apache.hadoop.hive.ql.exec.TableScanOperator;
 import org.apache.hadoop.hive.ql.exec.Task;
 import org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat;
+import org.apache.hadoop.hive.ql.io.NullScanFileSystem;
 import org.apache.hadoop.hive.ql.io.OneNullRowInputFormat;
 import org.apache.hadoop.hive.ql.lib.DefaultRuleDispatcher;
 import org.apache.hadoop.hive.ql.lib.Dispatcher;
@@ -104,13 +106,14 @@ public class NullScanTaskDispatcher implements Dispatcher {
       }
     }
     if (allowed.size() > 0) {
-      work.setUseOneNullRowInputFormat(true);
       PartitionDesc partDesc = work.getPathToPartitionInfo().get(path).clone();
       PartitionDesc newPartition = changePartitionToMetadataOnly(partDesc);
-      Path fakePath = new Path(physicalContext.getContext().getMRTmpPath()
-          + newPartition.getTableName() + encode(newPartition.getPartSpec()));
-      work.getPathToPartitionInfo().put(fakePath.getName(), newPartition);
-      work.getPathToAliases().put(fakePath.getName(), new ArrayList<String>(allowed));
+      // Prefix partition with something to avoid it being a hidden file.
+      Path fakePath = new Path(NullScanFileSystem.getBase() + newPartition.getTableName()
+          + "/part" + encode(newPartition.getPartSpec()));
+      String fakeStr = fakePath.toString();
+      work.getPathToPartitionInfo().put(fakeStr, newPartition);
+      work.getPathToAliases().put(fakeStr, new ArrayList<String>(allowed));
       aliasesAffected.removeAll(allowed);
       if (aliasesAffected.isEmpty()) {
         work.getPathToAliases().remove(path);
@@ -143,7 +146,7 @@ public class NullScanTaskDispatcher implements Dispatcher {
 
   // considered using URLEncoder, but it seemed too much
   private String encode(Map<String, String> partSpec) {
-    return partSpec.toString().replaceAll("[:/#\\?]", "_");
+    return partSpec.toString().replaceAll("[{}:/#\\?, ]+", "_");
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/8787b3dd/ql/src/java/org/apache/hadoop/hive/ql/plan/BaseWork.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/plan/BaseWork.java b/ql/src/java/org/apache/hadoop/hive/ql/plan/BaseWork.java
index 5914b1c..429a058 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/plan/BaseWork.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/plan/BaseWork.java
@@ -42,7 +42,7 @@ import org.apache.hadoop.hive.serde2.typeinfo.TypeInfo;
  */
 @SuppressWarnings({"serial"})
 public abstract class BaseWork extends AbstractOperatorDesc {
-  static final private Logger LOG = LoggerFactory.getLogger(BaseWork.class);
+  protected static final Logger LOG = LoggerFactory.getLogger(BaseWork.class);
 
   // dummyOps is a reference to all the HashTableDummy operators in the
   // plan. These have to be separately initialized when we setup a task.

http://git-wip-us.apache.org/repos/asf/hive/blob/8787b3dd/ql/src/java/org/apache/hadoop/hive/ql/plan/MapWork.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/plan/MapWork.java b/ql/src/java/org/apache/hadoop/hive/ql/plan/MapWork.java
index 3ef50fc..2da881d 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/plan/MapWork.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/plan/MapWork.java
@@ -115,8 +115,6 @@ public class MapWork extends BaseWork {
 
   private boolean useBucketizedHiveInputFormat;
 
-  private boolean useOneNullRowInputFormat;
-
   private boolean dummyTableScan = false;
 
   // used for dynamic partitioning
@@ -467,14 +465,6 @@ public class MapWork extends BaseWork {
     this.useBucketizedHiveInputFormat = useBucketizedHiveInputFormat;
   }
 
-  public void setUseOneNullRowInputFormat(boolean useOneNullRowInputFormat) {
-    this.useOneNullRowInputFormat = useOneNullRowInputFormat;
-  }
-
-  public boolean isUseOneNullRowInputFormat() {
-    return useOneNullRowInputFormat;
-  }
-
   public void setMapperCannotSpanPartns(boolean mapperCannotSpanPartns) {
     this.mapperCannotSpanPartns = mapperCannotSpanPartns;
   }

http://git-wip-us.apache.org/repos/asf/hive/blob/8787b3dd/ql/src/main/resources/META-INF/services/org.apache.hadoop.fs.FileSystem
----------------------------------------------------------------------
diff --git a/ql/src/main/resources/META-INF/services/org.apache.hadoop.fs.FileSystem b/ql/src/main/resources/META-INF/services/org.apache.hadoop.fs.FileSystem
new file mode 100644
index 0000000..257ceeb
--- /dev/null
+++ b/ql/src/main/resources/META-INF/services/org.apache.hadoop.fs.FileSystem
@@ -0,0 +1,14 @@
+#
+#   Licensed under the Apache License, Version 2.0 (the "License");
+#   you may not use this file except in compliance with the License.
+#   You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+#
+org.apache.hadoop.hive.ql.io.NullScanFileSystem

http://git-wip-us.apache.org/repos/asf/hive/blob/8787b3dd/ql/src/test/queries/clientpositive/llap_nullscan.q
----------------------------------------------------------------------
diff --git a/ql/src/test/queries/clientpositive/llap_nullscan.q b/ql/src/test/queries/clientpositive/llap_nullscan.q
new file mode 100644
index 0000000..eeb3100
--- /dev/null
+++ b/ql/src/test/queries/clientpositive/llap_nullscan.q
@@ -0,0 +1,30 @@
+set hive.mapred.mode=nonstrict;
+set hive.cbo.enable=false;
+set hive.explain.user=false;
+set hive.fetch.task.conversion=none;
+set hive.auto.convert.join=false;
+
+set hive.vectorized.execution.enabled=true;
+set hive.llap.io.enabled=true;
+ 
+drop table if exists src_orc;
+
+create table src_orc stored as orc as select * from srcpart limit 10;
+
+explain extended
+select * from src_orc where 1=2;
+select * from src_orc where 1=2;
+
+explain
+select * from (select key from src_orc where false) a left outer join (select key from src_orc limit 0) b on a.key=b.key;
+select * from (select key from src_orc where false) a left outer join (select key from src_orc limit 0) b on a.key=b.key;
+ 
+explain
+select count(key) from src_orc where false union all select count(key) from src_orc ;
+select count(key) from src_orc where false union all select count(key) from src_orc ;
+
+explain 
+select * from src_orc s1, src_orc s2 where false and s1.value = s2.value;
+select * from src_orc s1, src_orc s2 where false and s1.value = s2.value;
+
+drop table if exists src_orc;

http://git-wip-us.apache.org/repos/asf/hive/blob/8787b3dd/ql/src/test/results/clientpositive/llap/llap_nullscan.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/llap/llap_nullscan.q.out b/ql/src/test/results/clientpositive/llap/llap_nullscan.q.out
new file mode 100644
index 0000000..99ee341
--- /dev/null
+++ b/ql/src/test/results/clientpositive/llap/llap_nullscan.q.out
@@ -0,0 +1,464 @@
+PREHOOK: query: drop table if exists src_orc
+PREHOOK: type: DROPTABLE
+POSTHOOK: query: drop table if exists src_orc
+POSTHOOK: type: DROPTABLE
+PREHOOK: query: create table src_orc stored as orc as select * from srcpart limit 10
+PREHOOK: type: CREATETABLE_AS_SELECT
+PREHOOK: Input: default@srcpart
+PREHOOK: Input: default@srcpart@ds=2008-04-08/hr=11
+PREHOOK: Input: default@srcpart@ds=2008-04-08/hr=12
+PREHOOK: Input: default@srcpart@ds=2008-04-09/hr=11
+PREHOOK: Input: default@srcpart@ds=2008-04-09/hr=12
+PREHOOK: Output: database:default
+PREHOOK: Output: default@src_orc
+POSTHOOK: query: create table src_orc stored as orc as select * from srcpart limit 10
+POSTHOOK: type: CREATETABLE_AS_SELECT
+POSTHOOK: Input: default@srcpart
+POSTHOOK: Input: default@srcpart@ds=2008-04-08/hr=11
+POSTHOOK: Input: default@srcpart@ds=2008-04-08/hr=12
+POSTHOOK: Input: default@srcpart@ds=2008-04-09/hr=11
+POSTHOOK: Input: default@srcpart@ds=2008-04-09/hr=12
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@src_orc
+PREHOOK: query: explain extended
+select * from src_orc where 1=2
+PREHOOK: type: QUERY
+POSTHOOK: query: explain extended
+select * from src_orc where 1=2
+POSTHOOK: type: QUERY
+ABSTRACT SYNTAX TREE:
+  
+TOK_QUERY
+   TOK_FROM
+      TOK_TABREF
+         TOK_TABNAME
+            src_orc
+   TOK_INSERT
+      TOK_DESTINATION
+         TOK_DIR
+            TOK_TMP_FILE
+      TOK_SELECT
+         TOK_SELEXPR
+            TOK_ALLCOLREF
+      TOK_WHERE
+         =
+            1
+            2
+
+
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+  Stage: Stage-1
+    Tez
+#### A masked pattern was here ####
+      Vertices:
+        Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: src_orc
+                  Statistics: Num rows: 10 Data size: 3560 Basic stats: COMPLETE Column stats: NONE
+                  GatherStats: false
+                  Filter Operator
+                    isSamplingPred: false
+                    predicate: false (type: boolean)
+                    Statistics: Num rows: 1 Data size: 356 Basic stats: COMPLETE Column stats: NONE
+                    Select Operator
+                      expressions: key (type: string), value (type: string), ds (type: string), hr (type: string)
+                      outputColumnNames: _col0, _col1, _col2, _col3
+                      Statistics: Num rows: 1 Data size: 356 Basic stats: COMPLETE Column stats: NONE
+                      File Output Operator
+                        compressed: false
+                        GlobalTableId: 0
+#### A masked pattern was here ####
+                        NumFilesPerFileSink: 1
+                        Statistics: Num rows: 1 Data size: 356 Basic stats: COMPLETE Column stats: NONE
+#### A masked pattern was here ####
+                        table:
+                            input format: org.apache.hadoop.mapred.TextInputFormat
+                            output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                            properties:
+                              columns _col0,_col1,_col2,_col3
+                              columns.types string:string:string:string
+                              escape.delim \
+                              hive.serialization.extend.additional.nesting.levels true
+                              serialization.escape.crlf true
+                              serialization.format 1
+                              serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                            serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                        TotalFiles: 1
+                        GatherStats: false
+                        MultiFileSpray: false
+            Execution mode: vectorized, llap
+            LLAP IO: no inputs
+            Path -> Alias:
+              nullscan://null/default.src_orc/part_ [src_orc]
+            Path -> Partition:
+              nullscan://null/default.src_orc/part_ 
+                Partition
+                  input format: org.apache.hadoop.hive.ql.io.OneNullRowInputFormat
+                  output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                  properties:
+                    COLUMN_STATS_ACCURATE {"BASIC_STATS":"true"}
+                    bucket_count -1
+                    columns key,value,ds,hr
+                    columns.comments 
+                    columns.types string:string:string:string
+#### A masked pattern was here ####
+                    name default.src_orc
+                    numFiles 1
+                    numRows 10
+                    rawDataSize 3560
+                    serialization.ddl struct src_orc { string key, string value, string ds, string hr}
+                    serialization.format 1
+                    serialization.lib org.apache.hadoop.hive.serde2.NullStructSerDe
+                    totalSize 633
+#### A masked pattern was here ####
+                  serde: org.apache.hadoop.hive.serde2.NullStructSerDe
+                
+                    input format: org.apache.hadoop.hive.ql.io.orc.OrcInputFormat
+                    output format: org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat
+                    properties:
+                      COLUMN_STATS_ACCURATE {"BASIC_STATS":"true"}
+                      bucket_count -1
+                      columns key,value,ds,hr
+                      columns.comments 
+                      columns.types string:string:string:string
+#### A masked pattern was here ####
+                      name default.src_orc
+                      numFiles 1
+                      numRows 10
+                      rawDataSize 3560
+                      serialization.ddl struct src_orc { string key, string value, string ds, string hr}
+                      serialization.format 1
+                      serialization.lib org.apache.hadoop.hive.ql.io.orc.OrcSerde
+                      totalSize 633
+#### A masked pattern was here ####
+                    serde: org.apache.hadoop.hive.ql.io.orc.OrcSerde
+                    name: default.src_orc
+                  name: default.src_orc
+            Truncated Path -> Alias:
+              nullscan://null/default.src_orc/part_ [src_orc]
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: select * from src_orc where 1=2
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src_orc
+#### A masked pattern was here ####
+POSTHOOK: query: select * from src_orc where 1=2
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src_orc
+#### A masked pattern was here ####
+PREHOOK: query: explain
+select * from (select key from src_orc where false) a left outer join (select key from src_orc limit 0) b on a.key=b.key
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+select * from (select key from src_orc where false) a left outer join (select key from src_orc limit 0) b on a.key=b.key
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+  Stage: Stage-1
+    Tez
+#### A masked pattern was here ####
+      Edges:
+        Reducer 2 <- Map 1 (SIMPLE_EDGE), Reducer 4 (SIMPLE_EDGE)
+        Reducer 4 <- Map 3 (SIMPLE_EDGE)
+#### A masked pattern was here ####
+      Vertices:
+        Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: src_orc
+                  Statistics: Num rows: 10 Data size: 3560 Basic stats: COMPLETE Column stats: NONE
+                  Filter Operator
+                    predicate: false (type: boolean)
+                    Statistics: Num rows: 1 Data size: 356 Basic stats: COMPLETE Column stats: NONE
+                    Select Operator
+                      expressions: key (type: string)
+                      outputColumnNames: _col0
+                      Statistics: Num rows: 1 Data size: 356 Basic stats: COMPLETE Column stats: NONE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: string)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: string)
+                        Statistics: Num rows: 1 Data size: 356 Basic stats: COMPLETE Column stats: NONE
+            Execution mode: vectorized, llap
+            LLAP IO: no inputs
+        Map 3 
+            Map Operator Tree:
+                TableScan
+                  alias: src_orc
+                  Statistics: Num rows: 10 Data size: 3560 Basic stats: COMPLETE Column stats: NONE
+                  Select Operator
+                    expressions: key (type: string)
+                    outputColumnNames: _col0
+                    Statistics: Num rows: 10 Data size: 3560 Basic stats: COMPLETE Column stats: NONE
+                    Limit
+                      Number of rows: 0
+                      Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
+                      Reduce Output Operator
+                        sort order: 
+                        Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
+                        value expressions: _col0 (type: string)
+            Execution mode: vectorized, llap
+            LLAP IO: no inputs
+        Reducer 2 
+            Execution mode: llap
+            Reduce Operator Tree:
+              Merge Join Operator
+                condition map:
+                     Left Outer Join0 to 1
+                keys:
+                  0 _col0 (type: string)
+                  1 _col0 (type: string)
+                outputColumnNames: _col0, _col1
+                Statistics: Num rows: 1 Data size: 391 Basic stats: COMPLETE Column stats: NONE
+                File Output Operator
+                  compressed: false
+                  Statistics: Num rows: 1 Data size: 391 Basic stats: COMPLETE Column stats: NONE
+                  table:
+                      input format: org.apache.hadoop.mapred.TextInputFormat
+                      output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                      serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+        Reducer 4 
+            Execution mode: vectorized, llap
+            Reduce Operator Tree:
+              Select Operator
+                expressions: VALUE._col0 (type: string)
+                outputColumnNames: _col0
+                Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
+                Limit
+                  Number of rows: 0
+                  Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
+                  Reduce Output Operator
+                    key expressions: _col0 (type: string)
+                    sort order: +
+                    Map-reduce partition columns: _col0 (type: string)
+                    Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: select * from (select key from src_orc where false) a left outer join (select key from src_orc limit 0) b on a.key=b.key
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src_orc
+#### A masked pattern was here ####
+POSTHOOK: query: select * from (select key from src_orc where false) a left outer join (select key from src_orc limit 0) b on a.key=b.key
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src_orc
+#### A masked pattern was here ####
+PREHOOK: query: explain
+select count(key) from src_orc where false union all select count(key) from src_orc
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+select count(key) from src_orc where false union all select count(key) from src_orc
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+  Stage: Stage-1
+    Tez
+#### A masked pattern was here ####
+      Edges:
+        Reducer 2 <- Map 1 (SIMPLE_EDGE), Union 3 (CONTAINS)
+        Reducer 5 <- Map 4 (SIMPLE_EDGE), Union 3 (CONTAINS)
+#### A masked pattern was here ####
+      Vertices:
+        Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: src_orc
+                  Statistics: Num rows: 10 Data size: 3560 Basic stats: COMPLETE Column stats: NONE
+                  Filter Operator
+                    predicate: false (type: boolean)
+                    Statistics: Num rows: 1 Data size: 356 Basic stats: COMPLETE Column stats: NONE
+                    Group By Operator
+                      aggregations: count(key)
+                      mode: hash
+                      outputColumnNames: _col0
+                      Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
+                      Reduce Output Operator
+                        sort order: 
+                        Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
+                        value expressions: _col0 (type: bigint)
+            Execution mode: vectorized, llap
+            LLAP IO: no inputs
+        Map 4 
+            Map Operator Tree:
+                TableScan
+                  alias: src_orc
+                  Statistics: Num rows: 10 Data size: 3560 Basic stats: COMPLETE Column stats: NONE
+                  Select Operator
+                    expressions: key (type: string)
+                    outputColumnNames: key
+                    Statistics: Num rows: 10 Data size: 3560 Basic stats: COMPLETE Column stats: NONE
+                    Group By Operator
+                      aggregations: count(key)
+                      mode: hash
+                      outputColumnNames: _col0
+                      Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
+                      Reduce Output Operator
+                        sort order: 
+                        Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
+                        value expressions: _col0 (type: bigint)
+            Execution mode: vectorized, llap
+            LLAP IO: all inputs
+        Reducer 2 
+            Execution mode: vectorized, uber
+            Reduce Operator Tree:
+              Group By Operator
+                aggregations: count(VALUE._col0)
+                mode: mergepartial
+                outputColumnNames: _col0
+                Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
+                File Output Operator
+                  compressed: false
+                  Statistics: Num rows: 2 Data size: 16 Basic stats: COMPLETE Column stats: NONE
+                  table:
+                      input format: org.apache.hadoop.mapred.TextInputFormat
+                      output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                      serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+        Reducer 5 
+            Execution mode: vectorized, uber
+            Reduce Operator Tree:
+              Group By Operator
+                aggregations: count(VALUE._col0)
+                mode: mergepartial
+                outputColumnNames: _col0
+                Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
+                File Output Operator
+                  compressed: false
+                  Statistics: Num rows: 2 Data size: 16 Basic stats: COMPLETE Column stats: NONE
+                  table:
+                      input format: org.apache.hadoop.mapred.TextInputFormat
+                      output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                      serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+        Union 3 
+            Vertex: Union 3
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: select count(key) from src_orc where false union all select count(key) from src_orc
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src_orc
+#### A masked pattern was here ####
+POSTHOOK: query: select count(key) from src_orc where false union all select count(key) from src_orc
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src_orc
+#### A masked pattern was here ####
+0
+10
+PREHOOK: query: explain 
+select * from src_orc s1, src_orc s2 where false and s1.value = s2.value
+PREHOOK: type: QUERY
+POSTHOOK: query: explain 
+select * from src_orc s1, src_orc s2 where false and s1.value = s2.value
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+  Stage: Stage-1
+    Tez
+#### A masked pattern was here ####
+      Edges:
+        Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 3 (SIMPLE_EDGE)
+#### A masked pattern was here ####
+      Vertices:
+        Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: s1
+                  Statistics: Num rows: 10 Data size: 3560 Basic stats: COMPLETE Column stats: NONE
+                  Filter Operator
+                    predicate: false (type: boolean)
+                    Statistics: Num rows: 1 Data size: 356 Basic stats: COMPLETE Column stats: NONE
+                    Reduce Output Operator
+                      key expressions: value (type: string)
+                      sort order: +
+                      Map-reduce partition columns: value (type: string)
+                      Statistics: Num rows: 1 Data size: 356 Basic stats: COMPLETE Column stats: NONE
+                      value expressions: key (type: string), ds (type: string), hr (type: string)
+            Execution mode: vectorized, llap
+            LLAP IO: no inputs
+        Map 3 
+            Map Operator Tree:
+                TableScan
+                  alias: s2
+                  Statistics: Num rows: 10 Data size: 3560 Basic stats: COMPLETE Column stats: NONE
+                  Filter Operator
+                    predicate: false (type: boolean)
+                    Statistics: Num rows: 1 Data size: 356 Basic stats: COMPLETE Column stats: NONE
+                    Reduce Output Operator
+                      key expressions: value (type: string)
+                      sort order: +
+                      Map-reduce partition columns: value (type: string)
+                      Statistics: Num rows: 1 Data size: 356 Basic stats: COMPLETE Column stats: NONE
+                      value expressions: key (type: string), ds (type: string), hr (type: string)
+            Execution mode: vectorized, llap
+            LLAP IO: no inputs
+        Reducer 2 
+            Execution mode: llap
+            Reduce Operator Tree:
+              Merge Join Operator
+                condition map:
+                     Inner Join 0 to 1
+                keys:
+                  0 value (type: string)
+                  1 value (type: string)
+                outputColumnNames: _col0, _col1, _col2, _col3, _col7, _col8, _col9, _col10
+                Statistics: Num rows: 1 Data size: 391 Basic stats: COMPLETE Column stats: NONE
+                Select Operator
+                  expressions: _col0 (type: string), _col1 (type: string), _col2 (type: string), _col3 (type: string), _col7 (type: string), _col8 (type: string), _col9 (type: string), _col10 (type: string)
+                  outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7
+                  Statistics: Num rows: 1 Data size: 391 Basic stats: COMPLETE Column stats: NONE
+                  File Output Operator
+                    compressed: false
+                    Statistics: Num rows: 1 Data size: 391 Basic stats: COMPLETE Column stats: NONE
+                    table:
+                        input format: org.apache.hadoop.mapred.TextInputFormat
+                        output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                        serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: select * from src_orc s1, src_orc s2 where false and s1.value = s2.value
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src_orc
+#### A masked pattern was here ####
+POSTHOOK: query: select * from src_orc s1, src_orc s2 where false and s1.value = s2.value
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src_orc
+#### A masked pattern was here ####
+PREHOOK: query: drop table if exists src_orc
+PREHOOK: type: DROPTABLE
+PREHOOK: Input: default@src_orc
+PREHOOK: Output: default@src_orc
+POSTHOOK: query: drop table if exists src_orc
+POSTHOOK: type: DROPTABLE
+POSTHOOK: Input: default@src_orc
+POSTHOOK: Output: default@src_orc

http://git-wip-us.apache.org/repos/asf/hive/blob/8787b3dd/ql/src/test/results/clientpositive/metadataonly1.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/metadataonly1.q.out b/ql/src/test/results/clientpositive/metadataonly1.q.out
index 8da7564..20089c6 100644
--- a/ql/src/test/results/clientpositive/metadataonly1.q.out
+++ b/ql/src/test/results/clientpositive/metadataonly1.q.out
@@ -159,9 +159,9 @@ STAGE PLANS:
                   value expressions: _col0 (type: string)
                   auto parallelism: false
       Path -> Alias:
-        -mr-10004default.test1{ds=1} [test1]
+        nullscan://null/default.test1/part_ds=1_ [test1]
       Path -> Partition:
-        -mr-10004default.test1{ds=1} 
+        nullscan://null/default.test1/part_ds=1_ 
           Partition
             input format: org.apache.hadoop.hive.ql.io.OneNullRowInputFormat
             output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
@@ -201,7 +201,7 @@ STAGE PLANS:
               name: default.test1
             name: default.test1
       Truncated Path -> Alias:
-        -mr-10004default.test1{ds=1} [test1]
+        nullscan://null/default.test1/part_ds=1_ [test1]
       Needs Tagging: false
       Reduce Operator Tree:
         Group By Operator
@@ -301,9 +301,9 @@ STAGE PLANS:
                   tag: -1
                   auto parallelism: false
       Path -> Alias:
-        -mr-10004default.test1{ds=1} [test1]
+        nullscan://null/default.test1/part_ds=1_ [test1]
       Path -> Partition:
-        -mr-10004default.test1{ds=1} 
+        nullscan://null/default.test1/part_ds=1_ 
           Partition
             input format: org.apache.hadoop.hive.ql.io.OneNullRowInputFormat
             output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
@@ -343,7 +343,7 @@ STAGE PLANS:
               name: default.test1
             name: default.test1
       Truncated Path -> Alias:
-        -mr-10004default.test1{ds=1} [test1]
+        nullscan://null/default.test1/part_ds=1_ [test1]
       Needs Tagging: false
       Reduce Operator Tree:
         Group By Operator
@@ -622,10 +622,10 @@ STAGE PLANS:
                   value expressions: _col0 (type: string)
                   auto parallelism: false
       Path -> Alias:
-        -mr-10006default.test1{ds=1} [$hdt$_1:$hdt$_1:a2]
-        -mr-10007default.test1{ds=2} [$hdt$_1:$hdt$_1:a2]
+        nullscan://null/default.test1/part_ds=1_ [$hdt$_1:$hdt$_1:a2]
+        nullscan://null/default.test1/part_ds=2_ [$hdt$_1:$hdt$_1:a2]
       Path -> Partition:
-        -mr-10006default.test1{ds=1} 
+        nullscan://null/default.test1/part_ds=1_ 
           Partition
             input format: org.apache.hadoop.hive.ql.io.OneNullRowInputFormat
             output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
@@ -664,7 +664,7 @@ STAGE PLANS:
               serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
               name: default.test1
             name: default.test1
-        -mr-10007default.test1{ds=2} 
+        nullscan://null/default.test1/part_ds=2_ 
           Partition
             input format: org.apache.hadoop.hive.ql.io.OneNullRowInputFormat
             output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
@@ -704,8 +704,8 @@ STAGE PLANS:
               name: default.test1
             name: default.test1
       Truncated Path -> Alias:
-        -mr-10006default.test1{ds=1} [$hdt$_1:$hdt$_1:a2]
-        -mr-10007default.test1{ds=2} [$hdt$_1:$hdt$_1:a2]
+        nullscan://null/default.test1/part_ds=1_ [$hdt$_1:$hdt$_1:a2]
+        nullscan://null/default.test1/part_ds=2_ [$hdt$_1:$hdt$_1:a2]
       Needs Tagging: false
       Reduce Operator Tree:
         Group By Operator
@@ -1074,11 +1074,11 @@ STAGE PLANS:
                   tag: -1
                   auto parallelism: false
       Path -> Alias:
-        -mr-10004default.test2{ds=1, hr=1} [test2]
-        -mr-10005default.test2{ds=1, hr=2} [test2]
-        -mr-10006default.test2{ds=1, hr=3} [test2]
+        nullscan://null/default.test2/part_ds=1_hr=1_ [test2]
+        nullscan://null/default.test2/part_ds=1_hr=2_ [test2]
+        nullscan://null/default.test2/part_ds=1_hr=3_ [test2]
       Path -> Partition:
-        -mr-10004default.test2{ds=1, hr=1} 
+        nullscan://null/default.test2/part_ds=1_hr=1_ 
           Partition
             input format: org.apache.hadoop.hive.ql.io.OneNullRowInputFormat
             output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
@@ -1118,7 +1118,7 @@ STAGE PLANS:
               serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
               name: default.test2
             name: default.test2
-        -mr-10005default.test2{ds=1, hr=2} 
+        nullscan://null/default.test2/part_ds=1_hr=2_ 
           Partition
             input format: org.apache.hadoop.hive.ql.io.OneNullRowInputFormat
             output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
@@ -1158,7 +1158,7 @@ STAGE PLANS:
               serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
               name: default.test2
             name: default.test2
-        -mr-10006default.test2{ds=1, hr=3} 
+        nullscan://null/default.test2/part_ds=1_hr=3_ 
           Partition
             input format: org.apache.hadoop.hive.ql.io.OneNullRowInputFormat
             output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
@@ -1199,9 +1199,9 @@ STAGE PLANS:
               name: default.test2
             name: default.test2
       Truncated Path -> Alias:
-        -mr-10004default.test2{ds=1, hr=1} [test2]
-        -mr-10005default.test2{ds=1, hr=2} [test2]
-        -mr-10006default.test2{ds=1, hr=3} [test2]
+        nullscan://null/default.test2/part_ds=1_hr=1_ [test2]
+        nullscan://null/default.test2/part_ds=1_hr=2_ [test2]
+        nullscan://null/default.test2/part_ds=1_hr=3_ [test2]
       Needs Tagging: false
       Reduce Operator Tree:
         Group By Operator
@@ -1545,10 +1545,10 @@ STAGE PLANS:
                   value expressions: _col0 (type: string)
                   auto parallelism: false
       Path -> Alias:
-        -mr-10004default.test1{ds=1} [test1]
-        -mr-10005default.test1{ds=2} [test1]
+        nullscan://null/default.test1/part_ds=1_ [test1]
+        nullscan://null/default.test1/part_ds=2_ [test1]
       Path -> Partition:
-        -mr-10004default.test1{ds=1} 
+        nullscan://null/default.test1/part_ds=1_ 
           Partition
             input format: org.apache.hadoop.hive.ql.io.OneNullRowInputFormat
             output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
@@ -1587,7 +1587,7 @@ STAGE PLANS:
               serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
               name: default.test1
             name: default.test1
-        -mr-10005default.test1{ds=2} 
+        nullscan://null/default.test1/part_ds=2_ 
           Partition
             input format: org.apache.hadoop.hive.ql.io.OneNullRowInputFormat
             output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
@@ -1627,8 +1627,8 @@ STAGE PLANS:
               name: default.test1
             name: default.test1
       Truncated Path -> Alias:
-        -mr-10004default.test1{ds=1} [test1]
-        -mr-10005default.test1{ds=2} [test1]
+        nullscan://null/default.test1/part_ds=1_ [test1]
+        nullscan://null/default.test1/part_ds=2_ [test1]
       Needs Tagging: false
       Reduce Operator Tree:
         Group By Operator
@@ -1788,13 +1788,13 @@ STAGE PLANS:
                   tag: -1
                   auto parallelism: false
       Path -> Alias:
-        -mr-10004default.test2{ds=01_10_10, hr=01} [test2]
-        -mr-10005default.test2{ds=01_10_20, hr=02} [test2]
-        -mr-10006default.test2{ds=1, hr=1} [test2]
-        -mr-10007default.test2{ds=1, hr=2} [test2]
-        -mr-10008default.test2{ds=1, hr=3} [test2]
+        nullscan://null/default.test2/part_ds=01_10_10_hr=01_ [test2]
+        nullscan://null/default.test2/part_ds=01_10_20_hr=02_ [test2]
+        nullscan://null/default.test2/part_ds=1_hr=1_ [test2]
+        nullscan://null/default.test2/part_ds=1_hr=2_ [test2]
+        nullscan://null/default.test2/part_ds=1_hr=3_ [test2]
       Path -> Partition:
-        -mr-10004default.test2{ds=01_10_10, hr=01} 
+        nullscan://null/default.test2/part_ds=01_10_10_hr=01_ 
           Partition
             input format: org.apache.hadoop.hive.ql.io.OneNullRowInputFormat
             output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
@@ -1834,7 +1834,7 @@ STAGE PLANS:
               serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
               name: default.test2
             name: default.test2
-        -mr-10005default.test2{ds=01_10_20, hr=02} 
+        nullscan://null/default.test2/part_ds=01_10_20_hr=02_ 
           Partition
             input format: org.apache.hadoop.hive.ql.io.OneNullRowInputFormat
             output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
@@ -1874,7 +1874,7 @@ STAGE PLANS:
               serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
               name: default.test2
             name: default.test2
-        -mr-10006default.test2{ds=1, hr=1} 
+        nullscan://null/default.test2/part_ds=1_hr=1_ 
           Partition
             input format: org.apache.hadoop.hive.ql.io.OneNullRowInputFormat
             output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
@@ -1914,7 +1914,7 @@ STAGE PLANS:
               serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
               name: default.test2
             name: default.test2
-        -mr-10007default.test2{ds=1, hr=2} 
+        nullscan://null/default.test2/part_ds=1_hr=2_ 
           Partition
             input format: org.apache.hadoop.hive.ql.io.OneNullRowInputFormat
             output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
@@ -1954,7 +1954,7 @@ STAGE PLANS:
               serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
               name: default.test2
             name: default.test2
-        -mr-10008default.test2{ds=1, hr=3} 
+        nullscan://null/default.test2/part_ds=1_hr=3_ 
           Partition
             input format: org.apache.hadoop.hive.ql.io.OneNullRowInputFormat
             output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
@@ -1995,11 +1995,11 @@ STAGE PLANS:
               name: default.test2
             name: default.test2
       Truncated Path -> Alias:
-        -mr-10004default.test2{ds=01_10_10, hr=01} [test2]
-        -mr-10005default.test2{ds=01_10_20, hr=02} [test2]
-        -mr-10006default.test2{ds=1, hr=1} [test2]
-        -mr-10007default.test2{ds=1, hr=2} [test2]
-        -mr-10008default.test2{ds=1, hr=3} [test2]
+        nullscan://null/default.test2/part_ds=01_10_10_hr=01_ [test2]
+        nullscan://null/default.test2/part_ds=01_10_20_hr=02_ [test2]
+        nullscan://null/default.test2/part_ds=1_hr=1_ [test2]
+        nullscan://null/default.test2/part_ds=1_hr=2_ [test2]
+        nullscan://null/default.test2/part_ds=1_hr=3_ [test2]
       Needs Tagging: false
       Reduce Operator Tree:
         Group By Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/8787b3dd/ql/src/test/results/clientpositive/optimize_nullscan.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/optimize_nullscan.q.out b/ql/src/test/results/clientpositive/optimize_nullscan.q.out
index 1f515c8..f3b2fe2 100644
--- a/ql/src/test/results/clientpositive/optimize_nullscan.q.out
+++ b/ql/src/test/results/clientpositive/optimize_nullscan.q.out
@@ -76,9 +76,9 @@ STAGE PLANS:
                   GatherStats: false
                   MultiFileSpray: false
       Path -> Alias:
-        -mr-10003default.src{} [src]
+        nullscan://null/default.src/part_ [src]
       Path -> Partition:
-        -mr-10003default.src{} 
+        nullscan://null/default.src/part_ 
           Partition
             input format: org.apache.hadoop.hive.ql.io.OneNullRowInputFormat
             output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
@@ -122,7 +122,7 @@ STAGE PLANS:
               name: default.src
             name: default.src
       Truncated Path -> Alias:
-        -mr-10003default.src{} [src]
+        nullscan://null/default.src/part_ [src]
 
   Stage: Stage-0
     Fetch Operator
@@ -339,12 +339,12 @@ STAGE PLANS:
                   value expressions: _col0 (type: string)
                   auto parallelism: false
       Path -> Alias:
-        -mr-10005default.srcpart{ds=2008-04-08, hr=11} [b:srcpart]
-        -mr-10006default.srcpart{ds=2008-04-08, hr=12} [b:srcpart]
-        -mr-10007default.srcpart{ds=2008-04-09, hr=11} [b:srcpart]
-        -mr-10008default.srcpart{ds=2008-04-09, hr=12} [b:srcpart]
+        nullscan://null/default.srcpart/part_ds=2008-04-08_hr=11_ [b:srcpart]
+        nullscan://null/default.srcpart/part_ds=2008-04-08_hr=12_ [b:srcpart]
+        nullscan://null/default.srcpart/part_ds=2008-04-09_hr=11_ [b:srcpart]
+        nullscan://null/default.srcpart/part_ds=2008-04-09_hr=12_ [b:srcpart]
       Path -> Partition:
-        -mr-10005default.srcpart{ds=2008-04-08, hr=11} 
+        nullscan://null/default.srcpart/part_ds=2008-04-08_hr=11_ 
           Partition
             input format: org.apache.hadoop.hive.ql.io.OneNullRowInputFormat
             output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
@@ -389,7 +389,7 @@ STAGE PLANS:
               serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
               name: default.srcpart
             name: default.srcpart
-        -mr-10006default.srcpart{ds=2008-04-08, hr=12} 
+        nullscan://null/default.srcpart/part_ds=2008-04-08_hr=12_ 
           Partition
             input format: org.apache.hadoop.hive.ql.io.OneNullRowInputFormat
             output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
@@ -434,7 +434,7 @@ STAGE PLANS:
               serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
               name: default.srcpart
             name: default.srcpart
-        -mr-10007default.srcpart{ds=2008-04-09, hr=11} 
+        nullscan://null/default.srcpart/part_ds=2008-04-09_hr=11_ 
           Partition
             input format: org.apache.hadoop.hive.ql.io.OneNullRowInputFormat
             output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
@@ -479,7 +479,7 @@ STAGE PLANS:
               serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
               name: default.srcpart
             name: default.srcpart
-        -mr-10008default.srcpart{ds=2008-04-09, hr=12} 
+        nullscan://null/default.srcpart/part_ds=2008-04-09_hr=12_ 
           Partition
             input format: org.apache.hadoop.hive.ql.io.OneNullRowInputFormat
             output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
@@ -525,10 +525,10 @@ STAGE PLANS:
               name: default.srcpart
             name: default.srcpart
       Truncated Path -> Alias:
-        -mr-10005default.srcpart{ds=2008-04-08, hr=11} [b:srcpart]
-        -mr-10006default.srcpart{ds=2008-04-08, hr=12} [b:srcpart]
-        -mr-10007default.srcpart{ds=2008-04-09, hr=11} [b:srcpart]
-        -mr-10008default.srcpart{ds=2008-04-09, hr=12} [b:srcpart]
+        nullscan://null/default.srcpart/part_ds=2008-04-08_hr=11_ [b:srcpart]
+        nullscan://null/default.srcpart/part_ds=2008-04-08_hr=12_ [b:srcpart]
+        nullscan://null/default.srcpart/part_ds=2008-04-09_hr=11_ [b:srcpart]
+        nullscan://null/default.srcpart/part_ds=2008-04-09_hr=12_ [b:srcpart]
       Needs Tagging: false
       Reduce Operator Tree:
         Select Operator
@@ -588,10 +588,30 @@ STAGE PLANS:
               tag: 1
               auto parallelism: false
       Path -> Alias:
-        -mr-10004default.src{} [a:src]
 #### A masked pattern was here ####
+        nullscan://null/default.src/part_ [a:src]
       Path -> Partition:
-        -mr-10004default.src{} 
+#### A masked pattern was here ####
+          Partition
+            base file name: -mr-10003
+            input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+            output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+            properties:
+              columns _col0
+              columns.types string
+              escape.delim \
+              serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+            serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+          
+              input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+              output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+              properties:
+                columns _col0
+                columns.types string
+                escape.delim \
+                serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+              serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+        nullscan://null/default.src/part_ 
           Partition
             input format: org.apache.hadoop.hive.ql.io.OneNullRowInputFormat
             output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
@@ -634,29 +654,9 @@ STAGE PLANS:
               serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
               name: default.src
             name: default.src
-#### A masked pattern was here ####
-          Partition
-            base file name: -mr-10003
-            input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-            output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-            properties:
-              columns _col0
-              columns.types string
-              escape.delim \
-              serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-            serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-          
-              input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-              output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-              properties:
-                columns _col0
-                columns.types string
-                escape.delim \
-                serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-              serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
       Truncated Path -> Alias:
-        -mr-10004default.src{} [a:src]
 #### A masked pattern was here ####
+        nullscan://null/default.src/part_ [a:src]
       Needs Tagging: true
       Reduce Operator Tree:
         Join Operator
@@ -798,9 +798,9 @@ STAGE PLANS:
                   value expressions: _col0 (type: bigint)
                   auto parallelism: false
       Path -> Alias:
-        -mr-10005default.src{} [null-subquery1:_u1-subquery1:src]
+        nullscan://null/default.src/part_ [null-subquery1:_u1-subquery1:src]
       Path -> Partition:
-        -mr-10005default.src{} 
+        nullscan://null/default.src/part_ 
           Partition
             input format: org.apache.hadoop.hive.ql.io.OneNullRowInputFormat
             output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
@@ -844,7 +844,7 @@ STAGE PLANS:
               name: default.src
             name: default.src
       Truncated Path -> Alias:
-        -mr-10005default.src{} [null-subquery1:_u1-subquery1:src]
+        nullscan://null/default.src/part_ [null-subquery1:_u1-subquery1:src]
       Needs Tagging: false
       Reduce Operator Tree:
         Group By Operator
@@ -1318,12 +1318,12 @@ STAGE PLANS:
                   value expressions: _col0 (type: string)
                   auto parallelism: false
       Path -> Alias:
-        -mr-10005default.srcpart{ds=2008-04-08, hr=11} [b:srcpart]
-        -mr-10006default.srcpart{ds=2008-04-08, hr=12} [b:srcpart]
-        -mr-10007default.srcpart{ds=2008-04-09, hr=11} [b:srcpart]
-        -mr-10008default.srcpart{ds=2008-04-09, hr=12} [b:srcpart]
+        nullscan://null/default.srcpart/part_ds=2008-04-08_hr=11_ [b:srcpart]
+        nullscan://null/default.srcpart/part_ds=2008-04-08_hr=12_ [b:srcpart]
+        nullscan://null/default.srcpart/part_ds=2008-04-09_hr=11_ [b:srcpart]
+        nullscan://null/default.srcpart/part_ds=2008-04-09_hr=12_ [b:srcpart]
       Path -> Partition:
-        -mr-10005default.srcpart{ds=2008-04-08, hr=11} 
+        nullscan://null/default.srcpart/part_ds=2008-04-08_hr=11_ 
           Partition
             input format: org.apache.hadoop.hive.ql.io.OneNullRowInputFormat
             output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
@@ -1368,7 +1368,7 @@ STAGE PLANS:
               serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
               name: default.srcpart
             name: default.srcpart
-        -mr-10006default.srcpart{ds=2008-04-08, hr=12} 
+        nullscan://null/default.srcpart/part_ds=2008-04-08_hr=12_ 
           Partition
             input format: org.apache.hadoop.hive.ql.io.OneNullRowInputFormat
             output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
@@ -1413,7 +1413,7 @@ STAGE PLANS:
               serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
               name: default.srcpart
             name: default.srcpart
-        -mr-10007default.srcpart{ds=2008-04-09, hr=11} 
+        nullscan://null/default.srcpart/part_ds=2008-04-09_hr=11_ 
           Partition
             input format: org.apache.hadoop.hive.ql.io.OneNullRowInputFormat
             output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
@@ -1458,7 +1458,7 @@ STAGE PLANS:
               serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
               name: default.srcpart
             name: default.srcpart
-        -mr-10008default.srcpart{ds=2008-04-09, hr=12} 
+        nullscan://null/default.srcpart/part_ds=2008-04-09_hr=12_ 
           Partition
             input format: org.apache.hadoop.hive.ql.io.OneNullRowInputFormat
             output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
@@ -1504,10 +1504,10 @@ STAGE PLANS:
               name: default.srcpart
             name: default.srcpart
       Truncated Path -> Alias:
-        -mr-10005default.srcpart{ds=2008-04-08, hr=11} [b:srcpart]
-        -mr-10006default.srcpart{ds=2008-04-08, hr=12} [b:srcpart]
-        -mr-10007default.srcpart{ds=2008-04-09, hr=11} [b:srcpart]
-        -mr-10008default.srcpart{ds=2008-04-09, hr=12} [b:srcpart]
+        nullscan://null/default.srcpart/part_ds=2008-04-08_hr=11_ [b:srcpart]
+        nullscan://null/default.srcpart/part_ds=2008-04-08_hr=12_ [b:srcpart]
+        nullscan://null/default.srcpart/part_ds=2008-04-09_hr=11_ [b:srcpart]
+        nullscan://null/default.srcpart/part_ds=2008-04-09_hr=12_ [b:srcpart]
       Needs Tagging: false
       Reduce Operator Tree:
         Select Operator
@@ -1565,10 +1565,30 @@ STAGE PLANS:
               value expressions: _col0 (type: string)
               auto parallelism: false
       Path -> Alias:
-        -mr-10004default.src{} [a:src]
 #### A masked pattern was here ####
+        nullscan://null/default.src/part_ [a:src]
       Path -> Partition:
-        -mr-10004default.src{} 
+#### A masked pattern was here ####
+          Partition
+            base file name: -mr-10003
+            input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+            output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+            properties:
+              columns _col0
+              columns.types string
+              escape.delim \
+              serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+            serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+          
+              input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+              output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+              properties:
+                columns _col0
+                columns.types string
+                escape.delim \
+                serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+              serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+        nullscan://null/default.src/part_ 
           Partition
             input format: org.apache.hadoop.hive.ql.io.OneNullRowInputFormat
             output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
@@ -1611,29 +1631,9 @@ STAGE PLANS:
               serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
               name: default.src
             name: default.src
-#### A masked pattern was here ####
-          Partition
-            base file name: -mr-10003
-            input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-            output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-            properties:
-              columns _col0
-              columns.types string
-              escape.delim \
-              serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-            serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-          
-              input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-              output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-              properties:
-                columns _col0
-                columns.types string
-                escape.delim \
-                serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-              serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
       Truncated Path -> Alias:
-        -mr-10004default.src{} [a:src]
 #### A masked pattern was here ####
+        nullscan://null/default.src/part_ [a:src]
       Needs Tagging: true
       Reduce Operator Tree:
         Join Operator
@@ -1797,9 +1797,9 @@ STAGE PLANS:
                 tag: 1
                 auto parallelism: false
       Path -> Alias:
-        -mr-10005default.src{} [null-subquery2:a-subquery2:src]
+        nullscan://null/default.src/part_ [null-subquery2:a-subquery2:src]
       Path -> Partition:
-        -mr-10005default.src{} 
+        nullscan://null/default.src/part_ 
           Partition
             input format: org.apache.hadoop.hive.ql.io.OneNullRowInputFormat
             output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
@@ -1843,7 +1843,7 @@ STAGE PLANS:
               name: default.src
             name: default.src
       Truncated Path -> Alias:
-        -mr-10005default.src{} [null-subquery2:a-subquery2:src]
+        nullscan://null/default.src/part_ [null-subquery2:a-subquery2:src]
       Needs Tagging: true
       Reduce Operator Tree:
         Join Operator
@@ -1938,10 +1938,30 @@ STAGE PLANS:
                 GatherStats: false
                 MultiFileSpray: false
       Path -> Alias:
-        -mr-10004default.src{} [null-subquery1:a-subquery1:src]
 #### A masked pattern was here ####
+        nullscan://null/default.src/part_ [null-subquery1:a-subquery1:src]
       Path -> Partition:
-        -mr-10004default.src{} 
+#### A masked pattern was here ####
+          Partition
+            base file name: -mr-10003
+            input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+            output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+            properties:
+              columns _col0
+              columns.types string
+              escape.delim \
+              serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+            serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+          
+              input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+              output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+              properties:
+                columns _col0
+                columns.types string
+                escape.delim \
+                serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+              serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+        nullscan://null/default.src/part_ 
           Partition
             input format: org.apache.hadoop.hive.ql.io.OneNullRowInputFormat
             output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
@@ -1984,29 +2004,9 @@ STAGE PLANS:
               serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
               name: default.src
             name: default.src
-#### A masked pattern was here ####
-          Partition
-            base file name: -mr-10003
-            input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-            output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-            properties:
-              columns _col0
-              columns.types string
-              escape.delim \
-              serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-            serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-          
-              input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-              output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-              properties:
-                columns _col0
-                columns.types string
-                escape.delim \
-                serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-              serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
       Truncated Path -> Alias:
-        -mr-10004default.src{} [null-subquery1:a-subquery1:src]
 #### A masked pattern was here ####
+        nullscan://null/default.src/part_ [null-subquery1:a-subquery1:src]
 
   Stage: Stage-0
     Fetch Operator
@@ -2105,9 +2105,9 @@ STAGE PLANS:
                 value expressions: key (type: string)
                 auto parallelism: false
       Path -> Alias:
-        -mr-10003default.src{} [s1, s2]
+        nullscan://null/default.src/part_ [s1, s2]
       Path -> Partition:
-        -mr-10003default.src{} 
+        nullscan://null/default.src/part_ 
           Partition
             input format: org.apache.hadoop.hive.ql.io.OneNullRowInputFormat
             output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
@@ -2151,7 +2151,7 @@ STAGE PLANS:
               name: default.src
             name: default.src
       Truncated Path -> Alias:
-        -mr-10003default.src{} [s1, s2]
+        nullscan://null/default.src/part_ [s1, s2]
       Needs Tagging: true
       Reduce Operator Tree:
         Join Operator
@@ -2259,9 +2259,9 @@ STAGE PLANS:
                   value expressions: _col0 (type: bigint)
                   auto parallelism: false
       Path -> Alias:
-        -mr-10003default.src{} [src]
+        nullscan://null/default.src/part_ [src]
       Path -> Partition:
-        -mr-10003default.src{} 
+        nullscan://null/default.src/part_ 
           Partition
             input format: org.apache.hadoop.hive.ql.io.OneNullRowInputFormat
             output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
@@ -2305,7 +2305,7 @@ STAGE PLANS:
               name: default.src
             name: default.src
       Truncated Path -> Alias:
-        -mr-10003default.src{} [src]
+        nullscan://null/default.src/part_ [src]
       Needs Tagging: false
       Reduce Operator Tree:
         Group By Operator


Mime
View raw message