hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mmccl...@apache.org
Subject [41/51] [partial] hive git commit: HIVE-17433: Vectorization: Support Decimal64 in Hive Query Engine (Matt McCline, reviewed by Teddy Choi)
Date Sun, 29 Oct 2017 20:40:20 GMT
http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncDecimalToTimestamp.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncDecimalToTimestamp.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncDecimalToTimestamp.java
index 569d7f7..62ae770 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncDecimalToTimestamp.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncDecimalToTimestamp.java
@@ -28,17 +28,20 @@ import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch;
  * operate directly on the input and set the output.
  */
 public abstract class FuncDecimalToTimestamp extends VectorExpression {
+
   private static final long serialVersionUID = 1L;
-  int inputColumn;
-  int outputColumn;
+  private final int inputColumn;
 
-  public FuncDecimalToTimestamp(int inputColumn, int outputColumn) {
+  public FuncDecimalToTimestamp(int inputColumn, int outputColumnNum) {
+    super(outputColumnNum);
     this.inputColumn = inputColumn;
-    this.outputColumn = outputColumn;
   }
 
   public FuncDecimalToTimestamp() {
     super();
+
+    // Dummy final assignments.
+    inputColumn = -1;
   }
 
   abstract protected void func(TimestampColumnVector outV, DecimalColumnVector inV, int i);
@@ -53,7 +56,7 @@ public abstract class FuncDecimalToTimestamp extends VectorExpression {
     DecimalColumnVector inV = (DecimalColumnVector) batch.cols[inputColumn];
     int[] sel = batch.selected;
     int n = batch.size;
-    TimestampColumnVector outV = (TimestampColumnVector) batch.cols[outputColumn];
+    TimestampColumnVector outV = (TimestampColumnVector) batch.cols[outputColumnNum];
 
     if (n == 0) {
 
@@ -110,20 +113,9 @@ public abstract class FuncDecimalToTimestamp extends VectorExpression {
     }
   }
 
-
-  @Override
-  public int getOutputColumn() {
-    return outputColumn;
-  }
-
-  @Override
-  public String getOutputType() {
-    return "timestamp";
-  }
-
   @Override
   public String vectorExpressionParameters() {
-    return "col " + inputColumn;
+    return getColumnParamString(0, inputColumn);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncDoubleToDecimal.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncDoubleToDecimal.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncDoubleToDecimal.java
index 1b3127c..f1f45e5 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncDoubleToDecimal.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncDoubleToDecimal.java
@@ -29,18 +29,18 @@ import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch;
  */
 public abstract class FuncDoubleToDecimal extends VectorExpression {
   private static final long serialVersionUID = 1L;
-  int inputColumn;
-  int outputColumn;
+  private final int inputColumn;
 
-  public FuncDoubleToDecimal(int inputColumn, int outputColumn) {
+  public FuncDoubleToDecimal(int inputColumn, int outputColumnNum) {
+    super(outputColumnNum);
     this.inputColumn = inputColumn;
-    this.outputColumn = outputColumn;
-    this.outputType = "decimal";
   }
 
   public FuncDoubleToDecimal() {
     super();
-    this.outputType = "decimal";
+
+    // Dummy final assignments.
+    inputColumn = -1;
   }
 
   abstract protected void func(DecimalColumnVector outV, DoubleColumnVector inV, int i);
@@ -55,7 +55,7 @@ public abstract class FuncDoubleToDecimal extends VectorExpression {
     DoubleColumnVector inV = (DoubleColumnVector) batch.cols[inputColumn];
     int[] sel = batch.selected;
     int n = batch.size;
-    DecimalColumnVector outV = (DecimalColumnVector) batch.cols[outputColumn];
+    DecimalColumnVector outV = (DecimalColumnVector) batch.cols[outputColumnNum];
 
     if (n == 0) {
 
@@ -112,26 +112,8 @@ public abstract class FuncDoubleToDecimal extends VectorExpression {
     }
   }
 
-
-  @Override
-  public int getOutputColumn() {
-    return outputColumn;
-  }
-
-  public void setOutputColumn(int outputColumn) {
-    this.outputColumn = outputColumn;
-  }
-
-  public int getInputColumn() {
-    return inputColumn;
-  }
-
-  public void setInputColumn(int inputColumn) {
-    this.inputColumn = inputColumn;
-  }
-
   public String vectorExpressionParameters() {
-    return "col " + inputColumn;
+    return getColumnParamString(0, inputColumn);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncHex.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncHex.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncHex.java
index 7ccbee6..425ad1c 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncHex.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncHex.java
@@ -24,8 +24,8 @@ import org.apache.hadoop.hive.ql.exec.vector.BytesColumnVector;
 public class FuncHex extends FuncLongToString {
   private static final long serialVersionUID = 1L;
 
-  public FuncHex(int inputCol, int outputCol) {
-    super(inputCol, outputCol);
+  public FuncHex(int inputCol, int outputColumnNum) {
+    super(inputCol, outputColumnNum);
   }
 
   public FuncHex() {

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncLogWithBaseDoubleToDouble.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncLogWithBaseDoubleToDouble.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncLogWithBaseDoubleToDouble.java
index d1fb7be..4414223 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncLogWithBaseDoubleToDouble.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncLogWithBaseDoubleToDouble.java
@@ -21,19 +21,21 @@ package org.apache.hadoop.hive.ql.exec.vector.expressions;
 import org.apache.hadoop.hive.ql.exec.vector.VectorExpressionDescriptor;
 
 
-public class FuncLogWithBaseDoubleToDouble extends MathFuncDoubleToDouble
-    implements ISetDoubleArg {
+public class FuncLogWithBaseDoubleToDouble extends MathFuncDoubleToDouble {
   private static final long serialVersionUID = 1L;
 
-  private double base;
+  private final double base;
 
-  public FuncLogWithBaseDoubleToDouble(double scalarVal, int colNum, int outputColumn) {
-    super(colNum, outputColumn);
+  public FuncLogWithBaseDoubleToDouble(double scalarVal, int colNum, int outputColumnNum) {
+    super(colNum, outputColumnNum);
     this.base = scalarVal;
   }
 
   public FuncLogWithBaseDoubleToDouble() {
     super();
+
+    // Dummy final assignments.
+    base = 0;
   }
 
   @Override
@@ -45,16 +47,6 @@ public class FuncLogWithBaseDoubleToDouble extends MathFuncDoubleToDouble
     return base;
   }
 
-  public void setBase(double base) {
-    this.base = base;
-  }
-
-  // used to set the second argument to function (a constant base)
-  @Override
-  public void setArg(double d) {
-    this.base = d;
-  }
-
   @Override
   public VectorExpressionDescriptor.Descriptor getDescriptor() {
     VectorExpressionDescriptor.Builder b = new VectorExpressionDescriptor.Builder();

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncLogWithBaseLongToDouble.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncLogWithBaseLongToDouble.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncLogWithBaseLongToDouble.java
index eafdb8b..822bac7 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncLogWithBaseLongToDouble.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncLogWithBaseLongToDouble.java
@@ -21,19 +21,21 @@ package org.apache.hadoop.hive.ql.exec.vector.expressions;
 import org.apache.hadoop.hive.ql.exec.vector.VectorExpressionDescriptor;
 
 
-public class FuncLogWithBaseLongToDouble extends MathFuncLongToDouble
-    implements ISetDoubleArg {
+public class FuncLogWithBaseLongToDouble extends MathFuncLongToDouble {
   private static final long serialVersionUID = 1L;
 
-  private double base;
+  private final double base;
 
-  public FuncLogWithBaseLongToDouble(double scalarVal, int colNum, int outputColumn) {
-    super(colNum, outputColumn);
+  public FuncLogWithBaseLongToDouble(double scalarVal, int colNum, int outputColumnNum) {
+    super(colNum, outputColumnNum);
     this.base = scalarVal;
   }
 
   public FuncLogWithBaseLongToDouble() {
     super();
+
+    // Dummy final assignments.
+    base = -1;
   }
 
   @Override
@@ -45,16 +47,6 @@ public class FuncLogWithBaseLongToDouble extends MathFuncLongToDouble
     return base;
   }
 
-  public void setBase(double base) {
-    this.base = base;
-  }
-
-  // used to set the second argument to function (a constant base)
-  @Override
-  public void setArg(double d) {
-    this.base = d;
-  }
-
   @Override
   public VectorExpressionDescriptor.Descriptor getDescriptor() {
     return (new VectorExpressionDescriptor.Builder())

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncLongToDecimal.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncLongToDecimal.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncLongToDecimal.java
index b527482..ee61ae5 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncLongToDecimal.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncLongToDecimal.java
@@ -29,18 +29,18 @@ import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch;
  */
 public abstract class FuncLongToDecimal extends VectorExpression {
   private static final long serialVersionUID = 1L;
-  int inputColumn;
-  int outputColumn;
+  private final int inputColumn;
 
-  public FuncLongToDecimal(int inputColumn, int outputColumn) {
+  public FuncLongToDecimal(int inputColumn, int outputColumnNum) {
+    super(outputColumnNum);
     this.inputColumn = inputColumn;
-    this.outputColumn = outputColumn;
-    this.outputType = "decimal";
   }
 
   public FuncLongToDecimal() {
     super();
-    this.outputType = "decimal";
+
+    // Dummy final assignments.
+    inputColumn = -1;
   }
 
   abstract protected void func(DecimalColumnVector outV, LongColumnVector inV, int i);
@@ -55,7 +55,7 @@ public abstract class FuncLongToDecimal extends VectorExpression {
     LongColumnVector inV = (LongColumnVector) batch.cols[inputColumn];
     int[] sel = batch.selected;
     int n = batch.size;
-    DecimalColumnVector outV = (DecimalColumnVector) batch.cols[outputColumn];
+    DecimalColumnVector outV = (DecimalColumnVector) batch.cols[outputColumnNum];
 
     if (n == 0) {
 
@@ -112,26 +112,8 @@ public abstract class FuncLongToDecimal extends VectorExpression {
     }
   }
 
-
-  @Override
-  public int getOutputColumn() {
-    return outputColumn;
-  }
-
-  public void setOutputColumn(int outputColumn) {
-    this.outputColumn = outputColumn;
-  }
-
-  public int getInputColumn() {
-    return inputColumn;
-  }
-
-  public void setInputColumn(int inputColumn) {
-    this.inputColumn = inputColumn;
-  }
-
   public String vectorExpressionParameters() {
-    return "col " + inputColumn;
+    return getColumnParamString(0, inputColumn);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncLongToString.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncLongToString.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncLongToString.java
index db45ed4..d536830 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncLongToString.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncLongToString.java
@@ -18,10 +18,14 @@
 
 package org.apache.hadoop.hive.ql.exec.vector.expressions;
 
+import java.sql.Timestamp;
+
 import org.apache.hadoop.hive.ql.exec.vector.BytesColumnVector;
 import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector;
 import org.apache.hadoop.hive.ql.exec.vector.VectorExpressionDescriptor;
 import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch;
+import org.apache.hadoop.hive.ql.metadata.HiveException;
+import org.apache.hadoop.hive.ql.util.DateTimeMath;
 
 /**
  * Superclass to support vectorized functions that take a long
@@ -31,18 +35,28 @@ import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch;
 public abstract class FuncLongToString extends VectorExpression {
   private static final long serialVersionUID = 1L;
 
-  private int inputCol;
-  private int outputCol;
-  protected transient byte[] bytes;
+  private final int inputColumn;
 
-  FuncLongToString(int inputCol, int outputCol) {
-    this.inputCol = inputCol;
-    this.outputCol = outputCol;
-    bytes = new byte[64];    // staging area for results, to avoid new() calls
+  // Transient members initialized by transientInit method.
+  protected byte[] bytes;
+
+  FuncLongToString(int inputColumn, int outputColumnNum) {
+    super(outputColumnNum);
+    this.inputColumn = inputColumn;
   }
 
   FuncLongToString() {
-    bytes = new byte[64];
+    super();
+
+    // Dummy final assignments.
+    inputColumn = -1;
+  }
+
+  @Override
+  public void transientInit() throws HiveException {
+    super.transientInit();
+
+    bytes = new byte[64];    // staging area for results, to avoid new() calls
   }
 
   @Override
@@ -52,11 +66,11 @@ public abstract class FuncLongToString extends VectorExpression {
       super.evaluateChildren(batch);
     }
 
-    LongColumnVector inputColVector = (LongColumnVector) batch.cols[inputCol];
+    LongColumnVector inputColVector = (LongColumnVector) batch.cols[inputColumn];
     int[] sel = batch.selected;
     int n = batch.size;
     long[] vector = inputColVector.vector;
-    BytesColumnVector outV = (BytesColumnVector) batch.cols[outputCol];
+    BytesColumnVector outV = (BytesColumnVector) batch.cols[outputColumnNum];
     outV.initBuffer();
 
     if (n == 0) {
@@ -118,34 +132,8 @@ public abstract class FuncLongToString extends VectorExpression {
   abstract void prepareResult(int i, long[] vector, BytesColumnVector outV);
 
   @Override
-  public int getOutputColumn() {
-    return outputCol;
-  }
-
-  public int getOutputCol() {
-    return outputCol;
-  }
-
-  public void setOutputCol(int outputCol) {
-    this.outputCol = outputCol;
-  }
-
-  public int getInputCol() {
-    return inputCol;
-  }
-
-  public void setInputCol(int inputCol) {
-    this.inputCol = inputCol;
-  }
-
-  @Override
-  public String getOutputType() {
-    return "String";
-  }
-
-  @Override
   public String vectorExpressionParameters() {
-    return "col " + inputCol;
+    return getColumnParamString(0, inputColumn);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncPowerDoubleToDouble.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncPowerDoubleToDouble.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncPowerDoubleToDouble.java
index 071a0e5..f10a4be 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncPowerDoubleToDouble.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncPowerDoubleToDouble.java
@@ -24,19 +24,21 @@ import org.apache.hadoop.hive.ql.exec.vector.VectorExpressionDescriptor;
 /**
  * Vectorized implementation for Pow(a, power) and Power(a, power)
  */
-public class FuncPowerDoubleToDouble extends MathFuncDoubleToDouble
-    implements ISetDoubleArg {
+public class FuncPowerDoubleToDouble extends MathFuncDoubleToDouble {
   private static final long serialVersionUID = 1L;
 
-  private double power;
+  private final double power;
 
-  public FuncPowerDoubleToDouble(int colNum, double power, int outputColumn) {
-    super(colNum, outputColumn);
+  public FuncPowerDoubleToDouble(int colNum, double power, int outputColumnNum) {
+    super(colNum, outputColumnNum);
     this.power = power;
   }
 
   public FuncPowerDoubleToDouble() {
     super();
+
+    // Dummy final assignments.
+    power = -1;
   }
 
   @Override
@@ -48,16 +50,6 @@ public class FuncPowerDoubleToDouble extends MathFuncDoubleToDouble
     return power;
   }
 
-  public void setPower(double power) {
-    this.power = power;
-  }
-
-  // set the second argument (the power)
-  @Override
-  public void setArg(double d) {
-    this.power = d;
-  }
-
   @Override
   protected void cleanup(DoubleColumnVector outputColVector, int[] sel,
       boolean selectedInUse, int n) {

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncPowerLongToDouble.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncPowerLongToDouble.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncPowerLongToDouble.java
index 1929d5a..a638c9f 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncPowerLongToDouble.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncPowerLongToDouble.java
@@ -24,19 +24,21 @@ import org.apache.hadoop.hive.ql.exec.vector.VectorExpressionDescriptor;
 /**
  * Vectorized implementation for Pow(a, power) and Power(a, power)
  */
-public class FuncPowerLongToDouble extends MathFuncLongToDouble
-    implements ISetDoubleArg {
+public class FuncPowerLongToDouble extends MathFuncLongToDouble {
   private static final long serialVersionUID = 1L;
 
-  private double power;
+  private final double power;
 
-  public FuncPowerLongToDouble(int colNum, double scalarVal, int outputColumn) {
-    super(colNum, outputColumn);
+  public FuncPowerLongToDouble(int colNum, double scalarVal, int outputColumnNum) {
+    super(colNum, outputColumnNum);
     this.power = scalarVal;
   }
 
   public FuncPowerLongToDouble() {
     super();
+
+    // Dummy final assignments.
+    power = -1;
   }
 
   @Override
@@ -48,16 +50,6 @@ public class FuncPowerLongToDouble extends MathFuncLongToDouble
     return power;
   }
 
-  public void setPower(double power) {
-    this.power = power;
-  }
-
-  // set the second argument (the power)
-  @Override
-  public void setArg(double d) {
-    this.power = d;
-  }
-
   @Override
   protected void cleanup(DoubleColumnVector outputColVector, int[] sel,
       boolean selectedInUse, int n) {

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncRand.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncRand.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncRand.java
index 0b9a82e..5aea598 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncRand.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncRand.java
@@ -30,15 +30,18 @@ import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch;
 public class FuncRand extends VectorExpression {
   private static final long serialVersionUID = 1L;
 
-  private int outputCol;
-  private Random random;
+  private final Random random;
 
-  public FuncRand(long seed, int outputCol) {
-    this.outputCol = outputCol;
+  public FuncRand(long seed, int outputColumnNum) {
+    super(outputColumnNum);
     this.random = new Random(seed);
   }
 
   public FuncRand() {
+    super();
+
+    // Dummy final assignments.
+    random = null;
   }
 
   @Override
@@ -48,7 +51,7 @@ public class FuncRand extends VectorExpression {
       this.evaluateChildren(batch);
     }
 
-    DoubleColumnVector outputColVector = (DoubleColumnVector) batch.cols[outputCol];
+    DoubleColumnVector outputColVector = (DoubleColumnVector) batch.cols[outputColumnNum];
     int[] sel = batch.selected;
     int n = batch.size;
     double[] outputVector = outputColVector.vector;
@@ -60,11 +63,6 @@ public class FuncRand extends VectorExpression {
       return;
     }
 
-    // For no-seed case, create new random number generator locally.
-    if (random == null) {
-      random = new Random();
-    }
-
     if (batch.selectedInUse) {
       for(int j = 0; j != n; j++) {
         int i = sel[j];
@@ -78,29 +76,9 @@ public class FuncRand extends VectorExpression {
  }
 
   @Override
-  public int getOutputColumn() {
-    return outputCol;
-  }
-
-  public int getOutputCol() {
-    return outputCol;
-  }
-
-  public void setOutputCol(int outputCol) {
-    this.outputCol = outputCol;
-  }
-
-  public Random getRandom() {
-    return random;
-  }
-
-  public void setRandom(Random random) {
-    this.random = random;
-  }
-
-  @Override
-  public String getOutputType() {
-    return "double";
+  public String vectorExpressionParameters() {
+    // No input parameters.
+    return null;
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncRandNoSeed.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncRandNoSeed.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncRandNoSeed.java
index 4453062..f208da1 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncRandNoSeed.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncRandNoSeed.java
@@ -30,15 +30,18 @@ import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch;
 public class FuncRandNoSeed extends VectorExpression {
   private static final long serialVersionUID = 1L;
 
-  private int outputCol;
-  private Random random;
+  private final Random random;
 
-  public FuncRandNoSeed(int outputCol) {
-    this.outputCol = outputCol;
+  public FuncRandNoSeed(int outputColumnNum) {
+    super(outputColumnNum);
     random = new Random();
   }
 
   public FuncRandNoSeed() {
+    super();
+
+    // Dummy final assignments.
+    random = null;
   }
 
   @Override
@@ -48,7 +51,7 @@ public class FuncRandNoSeed extends VectorExpression {
       this.evaluateChildren(batch);
     }
 
-    DoubleColumnVector outputColVector = (DoubleColumnVector) batch.cols[outputCol];
+    DoubleColumnVector outputColVector = (DoubleColumnVector) batch.cols[outputColumnNum];
     int[] sel = batch.selected;
     int n = batch.size;
     double[] outputVector = outputColVector.vector;
@@ -73,32 +76,6 @@ public class FuncRandNoSeed extends VectorExpression {
  }
 
   @Override
-  public int getOutputColumn() {
-    return outputCol;
-  }
-
-  public int getOutputCol() {
-    return outputCol;
-  }
-
-  public void setOutputCol(int outputCol) {
-    this.outputCol = outputCol;
-  }
-
-  public Random getRandom() {
-    return random;
-  }
-
-  public void setRandom(Random random) {
-    this.random = random;
-  }
-
-  @Override
-  public String getOutputType() {
-    return "double";
-  }
-
-  @Override
   public VectorExpressionDescriptor.Descriptor getDescriptor() {
     return (new VectorExpressionDescriptor.Builder())
         .setMode(
@@ -109,4 +86,9 @@ public class FuncRandNoSeed extends VectorExpression {
         .setInputExpressionTypes(
             VectorExpressionDescriptor.InputExpressionType.NONE).build();
   }
+
+  @Override
+  public String vectorExpressionParameters() {
+    return null;
+  }
 }

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncRoundWithNumDigitsDecimalToDecimal.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncRoundWithNumDigitsDecimalToDecimal.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncRoundWithNumDigitsDecimalToDecimal.java
index 9eead7b..d967127 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncRoundWithNumDigitsDecimalToDecimal.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncRoundWithNumDigitsDecimalToDecimal.java
@@ -31,20 +31,20 @@ import java.util.Arrays;
 public class FuncRoundWithNumDigitsDecimalToDecimal extends VectorExpression {
   private static final long serialVersionUID = 1L;
 
-  private int colNum;
-  private int outputColumn;
+  private final int colNum;
   private int decimalPlaces;
 
-  public FuncRoundWithNumDigitsDecimalToDecimal(int colNum, int scalarValue, int outputColumn) {
-    this();
+  public FuncRoundWithNumDigitsDecimalToDecimal(int colNum, int scalarValue, int outputColumnNum) {
+    super(outputColumnNum);
     this.colNum = colNum;
-    this.outputColumn = outputColumn;
     this.decimalPlaces = scalarValue;
-    this.outputType = "decimal";
   }
-  
+
   public FuncRoundWithNumDigitsDecimalToDecimal() {
     super();
+
+    // Dummy final assignments.
+    colNum = -1;
   }
 
   @Override
@@ -55,7 +55,7 @@ public class FuncRoundWithNumDigitsDecimalToDecimal extends VectorExpression {
     }
 
     DecimalColumnVector inputColVector = (DecimalColumnVector) batch.cols[colNum];
-    DecimalColumnVector outputColVector = (DecimalColumnVector) batch.cols[outputColumn];
+    DecimalColumnVector outputColVector = (DecimalColumnVector) batch.cols[outputColumnNum];
     int[] sel = batch.selected;
     boolean[] inputIsNull = inputColVector.isNull;
     boolean[] outputIsNull = outputColVector.isNull;
@@ -110,18 +110,8 @@ public class FuncRoundWithNumDigitsDecimalToDecimal extends VectorExpression {
     }
   }
 
-  @Override
-  public int getOutputColumn() {
-    return outputColumn;
-  }
-  
-  @Override
-  public String getOutputType() {
-    return outputType;
-  }
-
   public String vectorExpressionParameters() {
-    return "col " + colNum + ", decimalPlaces " + decimalPlaces;
+    return getColumnParamString(0, colNum) + ", decimalPlaces " + decimalPlaces;
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncTimestampToDecimal.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncTimestampToDecimal.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncTimestampToDecimal.java
index 5f4e83a..ed74dc4 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncTimestampToDecimal.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncTimestampToDecimal.java
@@ -29,18 +29,19 @@ import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch;
  */
 public abstract class FuncTimestampToDecimal extends VectorExpression {
   private static final long serialVersionUID = 1L;
-  int inputColumn;
-  int outputColumn;
 
-  public FuncTimestampToDecimal(int inputColumn, int outputColumn) {
+  private final int inputColumn;
+
+  public FuncTimestampToDecimal(int inputColumn, int outputColumnNum) {
+    super(outputColumnNum);
     this.inputColumn = inputColumn;
-    this.outputColumn = outputColumn;
-    this.outputType = "decimal";
   }
 
   public FuncTimestampToDecimal() {
     super();
-    this.outputType = "decimal";
+
+    // Dummy final assignments.
+    inputColumn = -1;
   }
 
   abstract protected void func(DecimalColumnVector outV, TimestampColumnVector inV, int i);
@@ -55,7 +56,7 @@ public abstract class FuncTimestampToDecimal extends VectorExpression {
     TimestampColumnVector inV = (TimestampColumnVector) batch.cols[inputColumn];
     int[] sel = batch.selected;
     int n = batch.size;
-    DecimalColumnVector outV = (DecimalColumnVector) batch.cols[outputColumn];
+    DecimalColumnVector outV = (DecimalColumnVector) batch.cols[outputColumnNum];
 
     if (n == 0) {
 
@@ -112,27 +113,9 @@ public abstract class FuncTimestampToDecimal extends VectorExpression {
     }
   }
 
-
-  @Override
-  public int getOutputColumn() {
-    return outputColumn;
-  }
-
-  public void setOutputColumn(int outputColumn) {
-    this.outputColumn = outputColumn;
-  }
-
-  public int getInputColumn() {
-    return inputColumn;
-  }
-
-  public void setInputColumn(int inputColumn) {
-    this.inputColumn = inputColumn;
-  }
-
   @Override
   public String vectorExpressionParameters() {
-    return "col " + inputColumn;
+    return getColumnParamString(0, inputColumn);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncTimestampToLong.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncTimestampToLong.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncTimestampToLong.java
index b652226..36d09bc 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncTimestampToLong.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncTimestampToLong.java
@@ -30,18 +30,19 @@ import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch;
  */
 public abstract class FuncTimestampToLong extends VectorExpression {
   private static final long serialVersionUID = 1L;
-  int inputColumn;
-  int outputColumn;
 
-  public FuncTimestampToLong(int inputColumn, int outputColumn) {
+  private final int inputColumn;
+
+  public FuncTimestampToLong(int inputColumn, int outputColumnNum) {
+    super(outputColumnNum);
     this.inputColumn = inputColumn;
-    this.outputColumn = outputColumn;
-    this.outputType = "long";
   }
 
   public FuncTimestampToLong() {
     super();
-    this.outputType = "long";
+
+    // Dummy final assignments.
+    inputColumn = -1;
   }
 
   abstract protected void func(LongColumnVector outV, TimestampColumnVector inV, int i);
@@ -56,7 +57,7 @@ public abstract class FuncTimestampToLong extends VectorExpression {
     TimestampColumnVector inV = (TimestampColumnVector) batch.cols[inputColumn];
     int[] sel = batch.selected;
     int n = batch.size;
-    LongColumnVector outV = (LongColumnVector) batch.cols[outputColumn];
+    LongColumnVector outV = (LongColumnVector) batch.cols[outputColumnNum];
 
     if (n == 0) {
 
@@ -113,27 +114,9 @@ public abstract class FuncTimestampToLong extends VectorExpression {
     }
   }
 
-
-  @Override
-  public int getOutputColumn() {
-    return outputColumn;
-  }
-
-  public void setOutputColumn(int outputColumn) {
-    this.outputColumn = outputColumn;
-  }
-
-  public int getInputColumn() {
-    return inputColumn;
-  }
-
-  public void setInputColumn(int inputColumn) {
-    this.inputColumn = inputColumn;
-  }
-
   @Override
   public String vectorExpressionParameters() {
-    return "col " + inputColumn;
+    return getColumnParamString(0, inputColumn);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ISetDoubleArg.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ISetDoubleArg.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ISetDoubleArg.java
deleted file mode 100644
index 0aaca52..0000000
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ISetDoubleArg.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/**
- * 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.exec.vector.expressions;
-
-// used to set the double precision constant argument to function (e.g. a constant base)
-public interface ISetDoubleArg {
-  void setArg(double d);
-}

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ISetLongArg.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ISetLongArg.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ISetLongArg.java
deleted file mode 100644
index b80bc9b..0000000
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ISetLongArg.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * 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.exec.vector.expressions;
-
-/* Used to set the long constant argument to function
- * (e.g. a constant number of digits to round to)
- */
-public interface ISetLongArg {
-  void setArg(long l);
-}

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IdentityExpression.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IdentityExpression.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IdentityExpression.java
index 2385a40..addf09d 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IdentityExpression.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IdentityExpression.java
@@ -27,15 +27,11 @@ public class IdentityExpression extends VectorExpression {
 
   private static final long serialVersionUID = 1L;
 
-  private int colNum = -1;
-  private String type = null;
-
   public IdentityExpression() {
   }
 
-  public IdentityExpression(int colNum, String type) {
-    this.colNum = colNum;
-    this.type = type;
+  public IdentityExpression(int colNum) {
+    super(colNum);
   }
 
   @Override
@@ -55,34 +51,9 @@ public class IdentityExpression extends VectorExpression {
   }
 
   @Override
-  public int getOutputColumn() {
-    return colNum;
-  }
-
-  @Override
-  public String getOutputType() {
-    return type;
-  }
-
-  public int getColNum() {
-    return getOutputColumn();
-  }
-
-  public String getType() {
-    return getOutputType();
-  }
-
-  public void setColNum(int colNum) {
-    this.colNum = colNum;
-  }
-
-  public void setType(String type) {
-    this.type = type;
-  }
-
-  @Override
   public String vectorExpressionParameters() {
-    return "col " + colNum;
+    return "col " + outputColumnNum + ":" +
+        getTypeName(outputTypeInfo, outputDataTypePhysicalVariation);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprCharScalarStringGroupColumn.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprCharScalarStringGroupColumn.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprCharScalarStringGroupColumn.java
index 2d46abf..3b4d3bb 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprCharScalarStringGroupColumn.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprCharScalarStringGroupColumn.java
@@ -32,8 +32,8 @@ public class IfExprCharScalarStringGroupColumn extends IfExprStringScalarStringG
 
   private static final long serialVersionUID = 1L;
 
-  public IfExprCharScalarStringGroupColumn(int arg1Column, HiveChar arg2Scalar, int arg3Column, int outputColumn) {
-    super(arg1Column, arg2Scalar.getValue().getBytes(), arg3Column, outputColumn);
+  public IfExprCharScalarStringGroupColumn(int arg1Column, HiveChar arg2Scalar, int arg3Column, int outputColumnNum) {
+    super(arg1Column, arg2Scalar.getValue().getBytes(), arg3Column, outputColumnNum);
    }
 
   public IfExprCharScalarStringGroupColumn() {

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprCharScalarStringScalar.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprCharScalarStringScalar.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprCharScalarStringScalar.java
index 3e756b6..44979c3 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprCharScalarStringScalar.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprCharScalarStringScalar.java
@@ -33,16 +33,12 @@ public class IfExprCharScalarStringScalar extends IfExprStringScalarStringScalar
   private static final long serialVersionUID = 1L;
 
   public IfExprCharScalarStringScalar(
-      int arg1Column, HiveChar arg2Scalar, byte[] arg3Scalar, int outputColumn) {
-    super(arg1Column, arg2Scalar.getValue().getBytes(), arg3Scalar, outputColumn);
+      int arg1Column, HiveChar arg2Scalar, byte[] arg3Scalar, int outputColumnNum) {
+    super(arg1Column, arg2Scalar.getValue().getBytes(), arg3Scalar, outputColumnNum);
   }
 
   public IfExprCharScalarStringScalar() {
-  }
-
-  @Override
-  public String getOutputType() {
-    return "String";
+    super();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprColumnNull.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprColumnNull.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprColumnNull.java
index 93e12ad..56312d9 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprColumnNull.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprColumnNull.java
@@ -30,6 +30,10 @@ public class IfExprColumnNull extends IfExprConditionalFilter {
     super(arg1Column, arg2Column, -1, outputColumn);
   }
 
+  public IfExprColumnNull() {
+    super();
+  }
+
   @Override
   public void evaluate(VectorizedRowBatch batch) {
 
@@ -38,7 +42,7 @@ public class IfExprColumnNull extends IfExprConditionalFilter {
     }
     final LongColumnVector arg1ColVector = (LongColumnVector) batch.cols[arg1Column];
     final ColumnVector arg2ColVector = batch.cols[arg2Column];
-    final ColumnVector outputColVector = batch.cols[outputColumn];
+    final ColumnVector outputColVector = batch.cols[outputColumnNum];
 
     final int[] sel = batch.selected;
     final int n = batch.size;
@@ -87,7 +91,7 @@ public class IfExprColumnNull extends IfExprConditionalFilter {
 
   @Override
   public String vectorExpressionParameters() {
-    return "col " + arg1Column + ", col "+ arg2Column + ", null";
+    return getColumnParamString(0, arg1Column) + ", " + getColumnParamString(1, arg2Column) + ", null";
   }
 
 }

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprConditionalFilter.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprConditionalFilter.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprConditionalFilter.java
index 97cade7..c17407e 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprConditionalFilter.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprConditionalFilter.java
@@ -31,13 +31,11 @@ public class IfExprConditionalFilter extends VectorExpression {
   protected int arg1Column = -1;
   protected int arg2Column = -1;
   protected int arg3Column = -1;
-  protected int outputColumn = -1;
   protected int arg2ColumnTmp = -1;
 
-  public IfExprConditionalFilter() {
-  }
-
-  public IfExprConditionalFilter(int arg1Column, int arg2Column, int arg3Column, int outputColumn) {
+  public IfExprConditionalFilter(int arg1Column, int arg2Column, int arg3Column,
+      int outputColumnNum) {
+    super(outputColumnNum);
     this.arg1Column = arg1Column;
     if(arg2Column == -1){
       this.arg2Column = arg3Column;
@@ -47,7 +45,10 @@ public class IfExprConditionalFilter extends VectorExpression {
       this.arg3Column = arg3Column;
       this.arg2ColumnTmp = arg2Column;
     }
-    this.outputColumn = outputColumn;
+  }
+
+  public IfExprConditionalFilter() {
+    super();
   }
 
   /**
@@ -85,7 +86,7 @@ public class IfExprConditionalFilter extends VectorExpression {
       if (childExpressions != null && childExpressions.length == 2) {
         // If the length is 2, it has two situations:If(expr1,expr2,null) or
         // If(expr1,null,expr3) distinguished by the indexes.
-        if (childExpressions[1].getOutputColumn() == arg2ColumnTmp) {
+        if (childExpressions[1].getOutputColumnNum() == arg2ColumnTmp) {
           // Evaluate the expr2 expression.
           childExpressions[1].evaluate(batch);
         } else {
@@ -154,7 +155,7 @@ public class IfExprConditionalFilter extends VectorExpression {
                                                     boolean prevSelectInUse) {
     batch.size = prevSize;
     batch.selectedInUse = prevSelectInUse;
-    int colNum = ve.getOutputColumn();
+    int colNum = ve.getOutputColumnNum();
     // Evaluate the conditional expression.
     ve.evaluate(batch);
     LongColumnVector outputColVector = (LongColumnVector) batch.cols[colNum];
@@ -180,13 +181,13 @@ public class IfExprConditionalFilter extends VectorExpression {
   }
 
   @Override
-  public int getOutputColumn() {
-    return outputColumn;
+  public VectorExpressionDescriptor.Descriptor getDescriptor() {
+    throw new UnsupportedOperationException("Undefined descriptor");
   }
 
   @Override
-  public VectorExpressionDescriptor.Descriptor getDescriptor() {
-    throw new UnsupportedOperationException("Undefined descriptor");
+  public String vectorExpressionParameters() {
+    return null;
   }
 }
 

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprDoubleColumnDoubleColumn.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprDoubleColumnDoubleColumn.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprDoubleColumnDoubleColumn.java
index 0e50a78..d0a9785 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprDoubleColumnDoubleColumn.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprDoubleColumnDoubleColumn.java
@@ -36,6 +36,7 @@ public class IfExprDoubleColumnDoubleColumn extends IfExprConditionalFilter {
   }
 
   public IfExprDoubleColumnDoubleColumn() {
+    super();
   }
 
   @Override
@@ -48,7 +49,7 @@ public class IfExprDoubleColumnDoubleColumn extends IfExprConditionalFilter {
     LongColumnVector arg1ColVector = (LongColumnVector) batch.cols[arg1Column];
     DoubleColumnVector arg2ColVector = (DoubleColumnVector) batch.cols[arg2Column];
     DoubleColumnVector arg3ColVector = (DoubleColumnVector) batch.cols[arg3Column];
-    DoubleColumnVector outputColVector = (DoubleColumnVector) batch.cols[outputColumn];
+    DoubleColumnVector outputColVector = (DoubleColumnVector) batch.cols[outputColumnNum];
     int[] sel = batch.selected;
     boolean[] outputIsNull = outputColVector.isNull;
     outputColVector.noNulls = arg2ColVector.noNulls && arg3ColVector.noNulls;
@@ -123,13 +124,9 @@ public class IfExprDoubleColumnDoubleColumn extends IfExprConditionalFilter {
   }
 
   @Override
-  public String getOutputType() {
-    return "double";
-  }
-
-  @Override
   public String vectorExpressionParameters() {
-    return "col " + arg1Column + ", col "+ arg2Column + ", col "+ arg3Column;
+    return getColumnParamString(0, arg1Column) + ", " + getColumnParamString(1, arg2Column) +
+        getColumnParamString(2, arg3Column);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprIntervalDayTimeColumnColumn.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprIntervalDayTimeColumnColumn.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprIntervalDayTimeColumnColumn.java
index 9627543..22a00f6 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprIntervalDayTimeColumnColumn.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprIntervalDayTimeColumnColumn.java
@@ -38,6 +38,7 @@ public class IfExprIntervalDayTimeColumnColumn extends IfExprConditionalFilter {
   public IfExprIntervalDayTimeColumnColumn() {
     super();
   }
+
   @Override
   public void evaluate(VectorizedRowBatch batch) {
 
@@ -48,7 +49,7 @@ public class IfExprIntervalDayTimeColumnColumn extends IfExprConditionalFilter {
     LongColumnVector arg1ColVector = (LongColumnVector) batch.cols[arg1Column];
     IntervalDayTimeColumnVector arg2ColVector = (IntervalDayTimeColumnVector) batch.cols[arg2Column];
     IntervalDayTimeColumnVector arg3ColVector = (IntervalDayTimeColumnVector) batch.cols[arg3Column];
-    IntervalDayTimeColumnVector outputColVector = (IntervalDayTimeColumnVector) batch.cols[outputColumn];
+    IntervalDayTimeColumnVector outputColVector = (IntervalDayTimeColumnVector) batch.cols[outputColumnNum];
     int[] sel = batch.selected;
     boolean[] outputIsNull = outputColVector.isNull;
     outputColVector.noNulls = arg2ColVector.noNulls && arg3ColVector.noNulls;
@@ -120,13 +121,9 @@ public class IfExprIntervalDayTimeColumnColumn extends IfExprConditionalFilter {
   }
 
   @Override
-  public String getOutputType() {
-    return "interval_day_time";
-  }
-
-  @Override
   public String vectorExpressionParameters() {
-    return "col " + arg1Column + ", col "+ arg2Column + ", col "+ arg3Column;
+    return getColumnParamString(0, arg1Column) + ", " + getColumnParamString(1, arg2Column) +
+        getColumnParamString(2, arg3Column);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprIntervalDayTimeColumnScalar.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprIntervalDayTimeColumnScalar.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprIntervalDayTimeColumnScalar.java
index 9dc3669..925716b 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprIntervalDayTimeColumnScalar.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprIntervalDayTimeColumnScalar.java
@@ -34,20 +34,25 @@ public class IfExprIntervalDayTimeColumnScalar extends VectorExpression {
 
   private static final long serialVersionUID = 1L;
 
-  private int arg1Column, arg2Column;
-  private HiveIntervalDayTime arg3Scalar;
-  private int outputColumn;
+  private final int arg1Column;
+  private final int arg2Column;
+  private final HiveIntervalDayTime arg3Scalar;
 
   public IfExprIntervalDayTimeColumnScalar(int arg1Column, int arg2Column, HiveIntervalDayTime arg3Scalar,
-      int outputColumn) {
+      int outputColumnNum) {
+    super(outputColumnNum);
     this.arg1Column = arg1Column;
     this.arg2Column = arg2Column;
     this.arg3Scalar = arg3Scalar;
-    this.outputColumn = outputColumn;
   }
 
   public IfExprIntervalDayTimeColumnScalar() {
     super();
+
+    // Dummy final assignments.
+    arg1Column = -1;
+    arg2Column = -1;
+    arg3Scalar = null;
   }
 
   @Override
@@ -59,7 +64,7 @@ public class IfExprIntervalDayTimeColumnScalar extends VectorExpression {
 
     LongColumnVector arg1ColVector = (LongColumnVector) batch.cols[arg1Column];
     IntervalDayTimeColumnVector arg2ColVector = (IntervalDayTimeColumnVector) batch.cols[arg2Column];
-    IntervalDayTimeColumnVector outputColVector = (IntervalDayTimeColumnVector) batch.cols[outputColumn];
+    IntervalDayTimeColumnVector outputColVector = (IntervalDayTimeColumnVector) batch.cols[outputColumnNum];
     int[] sel = batch.selected;
     boolean[] outputIsNull = outputColVector.isNull;
     outputColVector.noNulls = arg2ColVector.noNulls; // nulls can only come from arg2
@@ -120,18 +125,9 @@ public class IfExprIntervalDayTimeColumnScalar extends VectorExpression {
   }
 
   @Override
-  public int getOutputColumn() {
-    return outputColumn;
-  }
-
-  @Override
-  public String getOutputType() {
-    return "interval_day_time";
-  }
-
-  @Override
   public String vectorExpressionParameters() {
-    return "col " + arg1Column + ", col "+ arg2Column + ", val "+ arg3Scalar.toString();
+    return getColumnParamString(0, arg1Column) + ", " + getColumnParamString(1, arg2Column) +
+        ", val "+ arg3Scalar.toString();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprIntervalDayTimeScalarColumn.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprIntervalDayTimeScalarColumn.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprIntervalDayTimeScalarColumn.java
index 4d4649f..aa2cf1d 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprIntervalDayTimeScalarColumn.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprIntervalDayTimeScalarColumn.java
@@ -34,20 +34,25 @@ public class IfExprIntervalDayTimeScalarColumn extends VectorExpression {
 
   private static final long serialVersionUID = 1L;
 
-  private int arg1Column, arg3Column;
-  private HiveIntervalDayTime arg2Scalar;
-  private int outputColumn;
+  private final int arg1Column;
+  private final HiveIntervalDayTime arg2Scalar;
+  private final int arg3Column;
 
-  public IfExprIntervalDayTimeScalarColumn(int arg1Column, HiveIntervalDayTime arg2Scalar, int arg3Column,
-      int outputColumn) {
+  public IfExprIntervalDayTimeScalarColumn(int arg1Column, HiveIntervalDayTime arg2Scalar,
+      int arg3Column, int outputColumnNum) {
+    super(outputColumnNum);
     this.arg1Column = arg1Column;
     this.arg2Scalar = arg2Scalar;
     this.arg3Column = arg3Column;
-    this.outputColumn = outputColumn;
   }
 
   public IfExprIntervalDayTimeScalarColumn() {
     super();
+
+    // Dummy final assignments.
+    arg1Column = -1;
+    arg2Scalar = null;
+    arg3Column = -1;
   }
 
   @Override
@@ -59,7 +64,7 @@ public class IfExprIntervalDayTimeScalarColumn extends VectorExpression {
 
     LongColumnVector arg1ColVector = (LongColumnVector) batch.cols[arg1Column];
     IntervalDayTimeColumnVector arg3ColVector = (IntervalDayTimeColumnVector) batch.cols[arg3Column];
-    IntervalDayTimeColumnVector outputColVector = (IntervalDayTimeColumnVector) batch.cols[outputColumn];
+    IntervalDayTimeColumnVector outputColVector = (IntervalDayTimeColumnVector) batch.cols[outputColumnNum];
     int[] sel = batch.selected;
     boolean[] outputIsNull = outputColVector.isNull;
     outputColVector.noNulls = arg3ColVector.noNulls; // nulls can only come from arg3 column vector
@@ -122,18 +127,8 @@ public class IfExprIntervalDayTimeScalarColumn extends VectorExpression {
   }
 
   @Override
-  public int getOutputColumn() {
-    return outputColumn;
-  }
-
-  @Override
-  public String getOutputType() {
-    return "interval_day_time";
-  }
-
-  @Override
   public String vectorExpressionParameters() {
-    return "col " + arg1Column + ", val "+ arg2Scalar + ", col "+ arg3Column;
+    return getColumnParamString(0, arg1Column) + ", val "+ arg2Scalar + ", col "+ arg3Column;
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprIntervalDayTimeScalarScalar.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprIntervalDayTimeScalarScalar.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprIntervalDayTimeScalarScalar.java
index c8f3294..1a9e244 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprIntervalDayTimeScalarScalar.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprIntervalDayTimeScalarScalar.java
@@ -36,21 +36,25 @@ public class IfExprIntervalDayTimeScalarScalar extends VectorExpression {
 
   private static final long serialVersionUID = 1L;
 
-  private int arg1Column;
-  private HiveIntervalDayTime arg2Scalar;
-  private HiveIntervalDayTime arg3Scalar;
-  private int outputColumn;
+  private final int arg1Column;
+  private final HiveIntervalDayTime arg2Scalar;
+  private final HiveIntervalDayTime arg3Scalar;
 
-  public IfExprIntervalDayTimeScalarScalar(int arg1Column, HiveIntervalDayTime arg2Scalar, HiveIntervalDayTime arg3Scalar,
-      int outputColumn) {
+  public IfExprIntervalDayTimeScalarScalar(int arg1Column, HiveIntervalDayTime arg2Scalar,
+      HiveIntervalDayTime arg3Scalar, int outputColumnNum) {
+    super(outputColumnNum);
     this.arg1Column = arg1Column;
     this.arg2Scalar = arg2Scalar;
     this.arg3Scalar = arg3Scalar;
-    this.outputColumn = outputColumn;
   }
 
   public IfExprIntervalDayTimeScalarScalar() {
     super();
+
+    // Dummy final assignments.
+    arg1Column = -1;
+    arg2Scalar = null;
+    arg3Scalar = null;
   }
 
   @Override
@@ -61,7 +65,7 @@ public class IfExprIntervalDayTimeScalarScalar extends VectorExpression {
     }
 
     LongColumnVector arg1ColVector = (LongColumnVector) batch.cols[arg1Column];
-    IntervalDayTimeColumnVector outputColVector = (IntervalDayTimeColumnVector) batch.cols[outputColumn];
+    IntervalDayTimeColumnVector outputColVector = (IntervalDayTimeColumnVector) batch.cols[outputColumnNum];
     int[] sel = batch.selected;
     boolean[] outputIsNull = outputColVector.isNull;
     outputColVector.noNulls = false; // output is a scalar which we know is non null
@@ -110,18 +114,8 @@ public class IfExprIntervalDayTimeScalarScalar extends VectorExpression {
   }
 
   @Override
-  public int getOutputColumn() {
-    return outputColumn;
-  }
-
-  @Override
-  public String getOutputType() {
-    return "timestamp";
-  }
-
-  @Override
   public String vectorExpressionParameters() {
-    return "col " + arg1Column + ", val "+ arg2Scalar + ", val "+ arg3Scalar;
+    return getColumnParamString(0, arg1Column) + ", val "+ arg2Scalar + ", val "+ arg3Scalar;
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprLongColumnLongColumn.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprLongColumnLongColumn.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprLongColumnLongColumn.java
index 744d8f6..71346f0 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprLongColumnLongColumn.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprLongColumnLongColumn.java
@@ -35,6 +35,7 @@ public class IfExprLongColumnLongColumn extends IfExprConditionalFilter {
   }
 
   public IfExprLongColumnLongColumn() {
+    super();
   }
 
   @Override
@@ -47,7 +48,7 @@ public class IfExprLongColumnLongColumn extends IfExprConditionalFilter {
     LongColumnVector arg1ColVector = (LongColumnVector) batch.cols[arg1Column];
     LongColumnVector arg2ColVector = (LongColumnVector) batch.cols[arg2Column];
     LongColumnVector arg3ColVector = (LongColumnVector) batch.cols[arg3Column];
-    LongColumnVector outputColVector = (LongColumnVector) batch.cols[outputColumn];
+    LongColumnVector outputColVector = (LongColumnVector) batch.cols[outputColumnNum];
     int[] sel = batch.selected;
     boolean[] outputIsNull = outputColVector.isNull;
     outputColVector.noNulls = arg2ColVector.noNulls && arg3ColVector.noNulls;
@@ -122,13 +123,9 @@ public class IfExprLongColumnLongColumn extends IfExprConditionalFilter {
   }
 
   @Override
-  public String getOutputType() {
-    return "long";
-  }
-
-  @Override
   public String vectorExpressionParameters() {
-    return "col " + arg1Column + ", col "+ arg2Column + ", col "+ arg3Column;
+    return getColumnParamString(0, arg1Column) + ", " + getColumnParamString(1, arg2Column) +
+        ", " + getColumnParamString(1, arg3Column);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprNullColumn.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprNullColumn.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprNullColumn.java
index 842d620..99185a0 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprNullColumn.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprNullColumn.java
@@ -30,6 +30,10 @@ public class IfExprNullColumn extends IfExprConditionalFilter {
     super(arg1Column, -1, arg2Column, outputColumn);
   }
 
+  public IfExprNullColumn() {
+    super();
+  }
+
   @Override
   public void evaluate(VectorizedRowBatch batch) {
 
@@ -39,7 +43,7 @@ public class IfExprNullColumn extends IfExprConditionalFilter {
 
     final LongColumnVector arg1ColVector = (LongColumnVector) batch.cols[arg1Column];
     final ColumnVector arg2ColVector = batch.cols[arg2Column];
-    final ColumnVector outputColVector = batch.cols[outputColumn];
+    final ColumnVector outputColVector = batch.cols[outputColumnNum];
 
     final int[] sel = batch.selected;
     final int n = batch.size;
@@ -87,13 +91,8 @@ public class IfExprNullColumn extends IfExprConditionalFilter {
   }
 
   @Override
-  public int getOutputColumn() {
-    return outputColumn;
-  }
-
-  @Override
   public String vectorExpressionParameters() {
-    return "col " + arg1Column + ", null, col "+ arg2Column;
+    return getColumnParamString(0, arg1Column) + ", null, col "+ arg2Column;
   }
 
 }

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprStringGroupColumnCharScalar.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprStringGroupColumnCharScalar.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprStringGroupColumnCharScalar.java
index a03ae46..4430d0f 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprStringGroupColumnCharScalar.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprStringGroupColumnCharScalar.java
@@ -31,8 +31,8 @@ public class IfExprStringGroupColumnCharScalar extends IfExprStringGroupColumnSt
 
   private static final long serialVersionUID = 1L;
 
-  public IfExprStringGroupColumnCharScalar(int arg1Column, int arg2Column, HiveChar arg3Scalar, int outputColumn) {
-    super(arg1Column, arg2Column, arg3Scalar.getValue().getBytes(), outputColumn);
+  public IfExprStringGroupColumnCharScalar(int arg1Column, int arg2Column, HiveChar arg3Scalar, int outputColumnNum) {
+    super(arg1Column, arg2Column, arg3Scalar.getValue().getBytes(), outputColumnNum);
   }
 
   public IfExprStringGroupColumnCharScalar() {

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprStringGroupColumnStringGroupColumn.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprStringGroupColumnStringGroupColumn.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprStringGroupColumnStringGroupColumn.java
index eae2046..069f955 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprStringGroupColumnStringGroupColumn.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprStringGroupColumnStringGroupColumn.java
@@ -51,7 +51,7 @@ public class IfExprStringGroupColumnStringGroupColumn extends IfExprConditionalF
     LongColumnVector arg1ColVector = (LongColumnVector) batch.cols[arg1Column];
     BytesColumnVector arg2ColVector = (BytesColumnVector) batch.cols[arg2Column];
     BytesColumnVector arg3ColVector = (BytesColumnVector) batch.cols[arg3Column];
-    BytesColumnVector outputColVector = (BytesColumnVector) batch.cols[outputColumn];
+    BytesColumnVector outputColVector = (BytesColumnVector) batch.cols[outputColumnNum];
     int[] sel = batch.selected;
     boolean[] outputIsNull = outputColVector.isNull;
     outputColVector.noNulls = arg2ColVector.noNulls && arg3ColVector.noNulls;
@@ -161,13 +161,9 @@ public class IfExprStringGroupColumnStringGroupColumn extends IfExprConditionalF
   }
 
   @Override
-  public String getOutputType() {
-    return "String";
-  }	
-
-  @Override
   public String vectorExpressionParameters() {
-    return "col " + arg1Column + ", col "+ arg2Column + ", col "+ arg3Column;
+    return getColumnParamString(0, arg1Column) + ", " + getColumnParamString(1, arg2Column) +
+         ", " + getColumnParamString(2, arg2Column);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprStringGroupColumnStringScalar.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprStringGroupColumnStringScalar.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprStringGroupColumnStringScalar.java
index 915c6d8..08d0780 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprStringGroupColumnStringScalar.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprStringGroupColumnStringScalar.java
@@ -36,19 +36,25 @@ public class IfExprStringGroupColumnStringScalar extends VectorExpression {
 
   private static final long serialVersionUID = 1L;
 
-  private int arg1Column, arg2Column;
-  private byte[] arg3Scalar;
-  private int outputColumn;
+  private final int arg1Column;
+  private final int arg2Column;
+  private final byte[] arg3Scalar;
 
-  public IfExprStringGroupColumnStringScalar(int arg1Column, int arg2Column, byte[] arg3Scalar, int outputColumn) {
+  public IfExprStringGroupColumnStringScalar(int arg1Column, int arg2Column, byte[] arg3Scalar,
+      int outputColumnNum) {
+    super(outputColumnNum);
     this.arg1Column = arg1Column;
     this.arg2Column = arg2Column;
     this.arg3Scalar = arg3Scalar;
-    this.outputColumn = outputColumn;
   }
 
   public IfExprStringGroupColumnStringScalar() {
     super();
+
+    // Dummy final assignments.
+    arg1Column = -1;
+    arg2Column = -1;
+    arg3Scalar = null;
   }
 
   @Override
@@ -60,7 +66,7 @@ public class IfExprStringGroupColumnStringScalar extends VectorExpression {
 
     LongColumnVector arg1ColVector = (LongColumnVector) batch.cols[arg1Column];
     BytesColumnVector arg2ColVector = (BytesColumnVector) batch.cols[arg2Column];
-    BytesColumnVector outputColVector = (BytesColumnVector) batch.cols[outputColumn];
+    BytesColumnVector outputColVector = (BytesColumnVector) batch.cols[outputColumnNum];
     int[] sel = batch.selected;
     boolean[] outputIsNull = outputColVector.isNull;
     outputColVector.noNulls = arg2ColVector.noNulls;
@@ -156,18 +162,9 @@ public class IfExprStringGroupColumnStringScalar extends VectorExpression {
   }
 
   @Override
-  public int getOutputColumn() {
-    return outputColumn;
-  }
-
-  @Override
-  public String getOutputType() {
-    return "String";
-  }
-
-  @Override
   public String vectorExpressionParameters() {
-    return "col " + arg1Column + ", col "+ arg2Column + ", val "+ displayUtf8Bytes(arg3Scalar);
+    return getColumnParamString(0, arg1Column) + ", " + getColumnParamString(1, arg2Column) +
+        ", val "+ displayUtf8Bytes(arg3Scalar);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprStringGroupColumnVarCharScalar.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprStringGroupColumnVarCharScalar.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprStringGroupColumnVarCharScalar.java
index c8bad80..18620e9 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprStringGroupColumnVarCharScalar.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprStringGroupColumnVarCharScalar.java
@@ -31,8 +31,8 @@ public class IfExprStringGroupColumnVarCharScalar extends IfExprStringGroupColum
 
   private static final long serialVersionUID = 1L;
 
-  public IfExprStringGroupColumnVarCharScalar(int arg1Column, int arg2Column, HiveVarchar arg3Scalar, int outputColumn) {
-    super(arg1Column, arg2Column, arg3Scalar.getValue().getBytes(), outputColumn);
+  public IfExprStringGroupColumnVarCharScalar(int arg1Column, int arg2Column, HiveVarchar arg3Scalar, int outputColumnNum) {
+    super(arg1Column, arg2Column, arg3Scalar.getValue().getBytes(), outputColumnNum);
   }
 
   public IfExprStringGroupColumnVarCharScalar() {

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprStringScalarCharScalar.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprStringScalarCharScalar.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprStringScalarCharScalar.java
index 9315d8d..848ede5 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprStringScalarCharScalar.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprStringScalarCharScalar.java
@@ -33,16 +33,12 @@ public class IfExprStringScalarCharScalar extends IfExprStringScalarStringScalar
   private static final long serialVersionUID = 1L;
 
   public IfExprStringScalarCharScalar(
-      int arg1Column, byte[] arg2Scalar, HiveChar arg3Scalar, int outputColumn) {
-    super(arg1Column, arg2Scalar, arg3Scalar.getValue().getBytes(), outputColumn);
+      int arg1Column, byte[] arg2Scalar, HiveChar arg3Scalar, int outputColumnNum) {
+    super(arg1Column, arg2Scalar, arg3Scalar.getValue().getBytes(), outputColumnNum);
   }
 
   public IfExprStringScalarCharScalar() {
-  }
-
-  @Override
-  public String getOutputType() {
-    return "String";
+    super();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprStringScalarStringGroupColumn.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprStringScalarStringGroupColumn.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprStringScalarStringGroupColumn.java
index 11d51e3..0dc31a0 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprStringScalarStringGroupColumn.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprStringScalarStringGroupColumn.java
@@ -36,19 +36,26 @@ public class IfExprStringScalarStringGroupColumn extends VectorExpression {
 
   private static final long serialVersionUID = 1L;
 
-  private int arg1Column, arg3Column;
-  private byte[] arg2Scalar;
-  private int outputColumn;
+  private final int arg1Column;
+  private final byte[] arg2Scalar;
+  private final int arg3Column;
 
-  public IfExprStringScalarStringGroupColumn(int arg1Column, byte[] arg2Scalar, int arg3Column, int outputColumn) {
+
+  public IfExprStringScalarStringGroupColumn(int arg1Column, byte[] arg2Scalar, int arg3Column,
+      int outputColumnNum) {
+    super(outputColumnNum);
     this.arg1Column = arg1Column;
     this.arg2Scalar = arg2Scalar;
     this.arg3Column = arg3Column;
-    this.outputColumn = outputColumn;
   }
 
   public IfExprStringScalarStringGroupColumn() {
     super();
+
+    // Dummy final assignments.
+    arg1Column = -1;
+    arg2Scalar = null;
+    arg3Column = -1;
   }
 
   @Override
@@ -60,7 +67,7 @@ public class IfExprStringScalarStringGroupColumn extends VectorExpression {
 
     LongColumnVector arg1ColVector = (LongColumnVector) batch.cols[arg1Column];
     BytesColumnVector arg3ColVector = (BytesColumnVector) batch.cols[arg3Column];
-    BytesColumnVector outputColVector = (BytesColumnVector) batch.cols[outputColumn];
+    BytesColumnVector outputColVector = (BytesColumnVector) batch.cols[outputColumnNum];
     int[] sel = batch.selected;
     boolean[] outputIsNull = outputColVector.isNull;
     outputColVector.noNulls = arg3ColVector.noNulls;
@@ -156,18 +163,8 @@ public class IfExprStringScalarStringGroupColumn extends VectorExpression {
   }
 
   @Override
-  public int getOutputColumn() {
-    return outputColumn;
-  }
-
-  @Override
-  public String getOutputType() {
-    return "String";
-  }
-
-  @Override
   public String vectorExpressionParameters() {
-    return "col " + arg1Column + ", val "+ displayUtf8Bytes(arg2Scalar) + ", col "+ arg3Column;
+    return getColumnParamString(0, arg1Column) + ", val "+ displayUtf8Bytes(arg2Scalar) + getColumnParamString(2, arg3Column);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprStringScalarStringScalar.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprStringScalarStringScalar.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprStringScalarStringScalar.java
index bd6558c..149a931 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprStringScalarStringScalar.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprStringScalarStringScalar.java
@@ -36,20 +36,25 @@ public class IfExprStringScalarStringScalar extends VectorExpression {
 
   private static final long serialVersionUID = 1L;
 
-  private int arg1Column;
-  private byte[] arg2Scalar;
-  private byte[] arg3Scalar;
-  private int outputColumn;
+  private final int arg1Column;
+  private final byte[] arg2Scalar;
+  private final byte[] arg3Scalar;
 
   public IfExprStringScalarStringScalar(
-      int arg1Column, byte[] arg2Scalar, byte[] arg3Scalar, int outputColumn) {
+      int arg1Column, byte[] arg2Scalar, byte[] arg3Scalar, int outputColumnNum) {
+    super(outputColumnNum);
     this.arg1Column = arg1Column;
     this.arg2Scalar = arg2Scalar;
     this.arg3Scalar = arg3Scalar;
-    this.outputColumn = outputColumn;
   }
 
   public IfExprStringScalarStringScalar() {
+    super();
+
+    // Dummy final assignments.
+    arg1Column = -1;
+    arg2Scalar = null;
+    arg3Scalar = null;
   }
 
   @Override
@@ -60,7 +65,7 @@ public class IfExprStringScalarStringScalar extends VectorExpression {
     }
 
     LongColumnVector arg1ColVector = (LongColumnVector) batch.cols[arg1Column];
-    BytesColumnVector outputColVector = (BytesColumnVector) batch.cols[outputColumn];
+    BytesColumnVector outputColVector = (BytesColumnVector) batch.cols[outputColumnNum];
     int[] sel = batch.selected;
     outputColVector.noNulls = true; // output must be a scalar and neither one is null
     outputColVector.isRepeating = false; // may override later
@@ -125,18 +130,8 @@ public class IfExprStringScalarStringScalar extends VectorExpression {
   }
 
   @Override
-  public int getOutputColumn() {
-    return outputColumn;
-  }
-
-  @Override
-  public String getOutputType() {
-    return "String";
-  }
-
-  @Override
   public String vectorExpressionParameters() {
-    return "col " + arg1Column + ", val "+ displayUtf8Bytes(arg2Scalar) + ", val "+ displayUtf8Bytes(arg3Scalar);
+    return getColumnParamString(0, arg1Column) + ", val "+ displayUtf8Bytes(arg2Scalar) + ", val "+ displayUtf8Bytes(arg3Scalar);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprStringScalarVarCharScalar.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprStringScalarVarCharScalar.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprStringScalarVarCharScalar.java
index 1caa420..a0e1679 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprStringScalarVarCharScalar.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprStringScalarVarCharScalar.java
@@ -33,16 +33,12 @@ public class IfExprStringScalarVarCharScalar extends IfExprStringScalarStringSca
   private static final long serialVersionUID = 1L;
 
   public IfExprStringScalarVarCharScalar(
-      int arg1Column, byte[] arg2Scalar, HiveVarchar arg3Scalar, int outputColumn) {
-    super(arg1Column, arg2Scalar, arg3Scalar.getValue().getBytes(), outputColumn);
+      int arg1Column, byte[] arg2Scalar, HiveVarchar arg3Scalar, int outputColumnNum) {
+    super(arg1Column, arg2Scalar, arg3Scalar.getValue().getBytes(), outputColumnNum);
   }
 
   public IfExprStringScalarVarCharScalar() {
-  }
-
-  @Override
-  public String getOutputType() {
-    return "String";
+    super();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprTimestampColumnColumn.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprTimestampColumnColumn.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprTimestampColumnColumn.java
index a1e489b..579eead 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprTimestampColumnColumn.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprTimestampColumnColumn.java
@@ -28,8 +28,8 @@ public class IfExprTimestampColumnColumn extends IfExprTimestampColumnColumnBase
 
   private static final long serialVersionUID = 1L;
 
-  public IfExprTimestampColumnColumn(int arg1Column, int arg2Column, int arg3Column, int outputColumn) {
-    super(arg1Column, arg2Column, arg3Column, outputColumn);
+  public IfExprTimestampColumnColumn(int arg1Column, int arg2Column, int arg3Column, int outputColumnNum) {
+    super(arg1Column, arg2Column, arg3Column, outputColumnNum);
   }
 
   public IfExprTimestampColumnColumn() {

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprTimestampColumnColumnBase.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprTimestampColumnColumnBase.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprTimestampColumnColumnBase.java
index b45259d..690f04c 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprTimestampColumnColumnBase.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprTimestampColumnColumnBase.java
@@ -35,6 +35,7 @@ public abstract class IfExprTimestampColumnColumnBase extends IfExprConditionalF
   }
 
   public IfExprTimestampColumnColumnBase() {
+    super();
   }
 
   @Override
@@ -46,7 +47,7 @@ public abstract class IfExprTimestampColumnColumnBase extends IfExprConditionalF
     LongColumnVector arg1ColVector = (LongColumnVector) batch.cols[arg1Column];
     TimestampColumnVector arg2ColVector = (TimestampColumnVector) batch.cols[arg2Column];
     TimestampColumnVector arg3ColVector = (TimestampColumnVector) batch.cols[arg3Column];
-    TimestampColumnVector outputColVector = (TimestampColumnVector) batch.cols[outputColumn];
+    TimestampColumnVector outputColVector = (TimestampColumnVector) batch.cols[outputColumnNum];
     int[] sel = batch.selected;
     boolean[] outputIsNull = outputColVector.isNull;
     outputColVector.noNulls = arg2ColVector.noNulls && arg3ColVector.noNulls;
@@ -118,12 +119,8 @@ public abstract class IfExprTimestampColumnColumnBase extends IfExprConditionalF
   }
 
   @Override
-  public String getOutputType() {
-    return "long";
-  }
-
-  @Override
   public String vectorExpressionParameters() {
-    return "col " + arg1Column + ", col "+ arg2Column + ", col "+ arg3Column;
+    return getColumnParamString(0, arg1Column) + ", " + getColumnParamString(1, arg2Column) +
+        getColumnParamString(2, arg3Column);
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprTimestampColumnScalar.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprTimestampColumnScalar.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprTimestampColumnScalar.java
index ae997e0..33fd86d 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprTimestampColumnScalar.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprTimestampColumnScalar.java
@@ -33,8 +33,8 @@ public class IfExprTimestampColumnScalar extends IfExprTimestampColumnScalarBase
   private static final long serialVersionUID = 1L;
 
   public IfExprTimestampColumnScalar(int arg1Column, int arg2Column, Timestamp arg3Scalar,
-      int outputColumn) {
-    super(arg1Column, arg2Column, arg3Scalar, outputColumn);
+      int outputColumnNum) {
+    super(arg1Column, arg2Column, arg3Scalar, outputColumnNum);
   }
 
   public IfExprTimestampColumnScalar() {

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprTimestampColumnScalarBase.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprTimestampColumnScalarBase.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprTimestampColumnScalarBase.java
index eb0c1c0..336eedd 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprTimestampColumnScalarBase.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprTimestampColumnScalarBase.java
@@ -37,19 +37,25 @@ public abstract class IfExprTimestampColumnScalarBase extends VectorExpression {
 
   private static final long serialVersionUID = 1L;
 
-  private int arg1Column, arg2Column;
-  private Timestamp arg3Scalar;
-  private int outputColumn;
+  private final int arg1Column;
+  private final int arg2Column;
+  private final Timestamp arg3Scalar;
 
   public IfExprTimestampColumnScalarBase(int arg1Column, int arg2Column, Timestamp arg3Scalar,
-      int outputColumn) {
+      int outputColumnNum) {
+    super(outputColumnNum);
     this.arg1Column = arg1Column;
     this.arg2Column = arg2Column;
     this.arg3Scalar = arg3Scalar;
-    this.outputColumn = outputColumn;
   }
 
   public IfExprTimestampColumnScalarBase() {
+    super();
+
+    // Dummy final assignments.
+    arg1Column = -1;
+    arg2Column = -1;
+    arg3Scalar = null;
   }
 
   @Override
@@ -61,7 +67,7 @@ public abstract class IfExprTimestampColumnScalarBase extends VectorExpression {
 
     LongColumnVector arg1ColVector = (LongColumnVector) batch.cols[arg1Column];
     TimestampColumnVector arg2ColVector = (TimestampColumnVector) batch.cols[arg2Column];
-    TimestampColumnVector outputColVector = (TimestampColumnVector) batch.cols[outputColumn];
+    TimestampColumnVector outputColVector = (TimestampColumnVector) batch.cols[outputColumnNum];
     int[] sel = batch.selected;
     boolean[] outputIsNull = outputColVector.isNull;
     outputColVector.noNulls = arg2ColVector.noNulls; // nulls can only come from arg2
@@ -122,18 +128,8 @@ public abstract class IfExprTimestampColumnScalarBase extends VectorExpression {
   }
 
   @Override
-  public int getOutputColumn() {
-    return outputColumn;
-  }
-
-  @Override
-  public String getOutputType() {
-    return "timestamp";
-  }
-
-  @Override
   public String vectorExpressionParameters() {
-    return "col " + arg1Column + ", col "+ arg2Column + ", val "+ arg3Scalar;
+    return getColumnParamString(0, arg1Column) + ", " + getColumnParamString(1, arg2Column) +
+        ", val "+ arg3Scalar;
   }
-
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprTimestampScalarColumn.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprTimestampScalarColumn.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprTimestampScalarColumn.java
index 3d53df1..92561e9 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprTimestampScalarColumn.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprTimestampScalarColumn.java
@@ -33,8 +33,8 @@ public class IfExprTimestampScalarColumn extends IfExprTimestampScalarColumnBase
   private static final long serialVersionUID = 1L;
 
   public IfExprTimestampScalarColumn(int arg1Column, Timestamp arg2Scalar, int arg3Column,
-      int outputColumn) {
-    super(arg1Column, arg2Scalar, arg3Column, outputColumn);
+      int outputColumnNum) {
+    super(arg1Column, arg2Scalar, arg3Column, outputColumnNum);
   }
 
   public IfExprTimestampScalarColumn() {

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprTimestampScalarColumnBase.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprTimestampScalarColumnBase.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprTimestampScalarColumnBase.java
index 3e4a195..3aaff4f 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprTimestampScalarColumnBase.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprTimestampScalarColumnBase.java
@@ -36,19 +36,25 @@ public abstract class IfExprTimestampScalarColumnBase extends VectorExpression {
 
   private static final long serialVersionUID = 1L;
 
-  private int arg1Column, arg3Column;
+  private final int arg1Column;
   private Timestamp arg2Scalar;
-  private int outputColumn;
+  private final int arg3Column;
 
   public IfExprTimestampScalarColumnBase(int arg1Column, Timestamp arg2Scalar, int arg3Column,
-      int outputColumn) {
+      int outputColumnNum) {
+    super(outputColumnNum);
     this.arg1Column = arg1Column;
     this.arg2Scalar = arg2Scalar;
     this.arg3Column = arg3Column;
-    this.outputColumn = outputColumn;
   }
 
   public IfExprTimestampScalarColumnBase() {
+    super();
+
+    // Dummy final assignments.
+    arg1Column = -1;
+    arg2Scalar = null;
+    arg3Column = -1;
   }
 
   @Override
@@ -60,7 +66,7 @@ public abstract class IfExprTimestampScalarColumnBase extends VectorExpression {
 
     LongColumnVector arg1ColVector = (LongColumnVector) batch.cols[arg1Column];
     TimestampColumnVector arg3ColVector = (TimestampColumnVector) batch.cols[arg3Column];
-    TimestampColumnVector outputColVector = (TimestampColumnVector) batch.cols[outputColumn];
+    TimestampColumnVector outputColVector = (TimestampColumnVector) batch.cols[outputColumnNum];
     int[] sel = batch.selected;
     boolean[] outputIsNull = outputColVector.isNull;
     outputColVector.noNulls = arg3ColVector.noNulls; // nulls can only come from arg3 column vector
@@ -123,18 +129,9 @@ public abstract class IfExprTimestampScalarColumnBase extends VectorExpression {
   }
 
   @Override
-  public int getOutputColumn() {
-    return outputColumn;
-  }
-
-  @Override
-  public String getOutputType() {
-    return "timestamp";
-  }
-
-  @Override
   public String vectorExpressionParameters() {
-    return "col " + arg1Column + ", val "+ arg2Scalar + ", col "+ arg3Column;
+    return getColumnParamString(0, arg1Column) + ", val "+ arg2Scalar + ", " +
+        getColumnParamString(2, arg3Column);
   }
 
 }

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprTimestampScalarScalar.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprTimestampScalarScalar.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprTimestampScalarScalar.java
index cd00d3a..d8d8127 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprTimestampScalarScalar.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprTimestampScalarScalar.java
@@ -33,8 +33,8 @@ public class IfExprTimestampScalarScalar extends IfExprTimestampScalarScalarBase
   private static final long serialVersionUID = 1L;
 
   public IfExprTimestampScalarScalar(int arg1Column, Timestamp arg2Scalar, Timestamp arg3Scalar,
-      int outputColumn) {
-    super(arg1Column, arg2Scalar, arg3Scalar, outputColumn);
+      int outputColumnNum) {
+    super(arg1Column, arg2Scalar, arg3Scalar, outputColumnNum);
   }
 
   public IfExprTimestampScalarScalar() {


Mime
View raw message