hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mmccl...@apache.org
Subject [50/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:29 GMT
http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/gen/vectorization/ExpressionTemplates/DTIColumnCompareScalar.txt
----------------------------------------------------------------------
diff --git a/ql/src/gen/vectorization/ExpressionTemplates/DTIColumnCompareScalar.txt b/ql/src/gen/vectorization/ExpressionTemplates/DTIColumnCompareScalar.txt
index 60884cd..3d05eaa 100644
--- a/ql/src/gen/vectorization/ExpressionTemplates/DTIColumnCompareScalar.txt
+++ b/ql/src/gen/vectorization/ExpressionTemplates/DTIColumnCompareScalar.txt
@@ -31,8 +31,8 @@ public class <ClassName> extends <BaseClassName> {
 
   private static final long serialVersionUID = 1L;
 
-  public <ClassName>(int colNum, long value, int outputColumn) {
-    super(colNum, value, outputColumn);
+  public <ClassName>(int colNum, long value, int outputColumnNum) {
+    super(colNum, value, outputColumnNum);
   }
 
   public <ClassName>() {

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/gen/vectorization/ExpressionTemplates/DTIScalarArithmeticDTIColumnNoConvert.txt
----------------------------------------------------------------------
diff --git a/ql/src/gen/vectorization/ExpressionTemplates/DTIScalarArithmeticDTIColumnNoConvert.txt b/ql/src/gen/vectorization/ExpressionTemplates/DTIScalarArithmeticDTIColumnNoConvert.txt
index 04607f6..11ceb17 100644
--- a/ql/src/gen/vectorization/ExpressionTemplates/DTIScalarArithmeticDTIColumnNoConvert.txt
+++ b/ql/src/gen/vectorization/ExpressionTemplates/DTIScalarArithmeticDTIColumnNoConvert.txt
@@ -36,8 +36,8 @@ public class <ClassName> extends LongScalar<OperatorName>LongColumn {
 
   private static final long serialVersionUID = 1L;
 
-  public <ClassName>(long value, int colNum, int outputColumn) {
-    super(value, colNum, outputColumn);
+  public <ClassName>(long value, int colNum, int outputColumnNum) {
+    super(value, colNum, outputColumnNum);
   }
 
   public <ClassName>() {

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/gen/vectorization/ExpressionTemplates/DTIScalarCompareColumn.txt
----------------------------------------------------------------------
diff --git a/ql/src/gen/vectorization/ExpressionTemplates/DTIScalarCompareColumn.txt b/ql/src/gen/vectorization/ExpressionTemplates/DTIScalarCompareColumn.txt
index d518c44..e4d2b3a 100644
--- a/ql/src/gen/vectorization/ExpressionTemplates/DTIScalarCompareColumn.txt
+++ b/ql/src/gen/vectorization/ExpressionTemplates/DTIScalarCompareColumn.txt
@@ -36,8 +36,8 @@ public class <ClassName> extends <BaseClassName> {
 
   private static final long serialVersionUID = 1L;
 
-  public <ClassName>(long value, int colNum, int outputColumn) {
-    super(value, colNum, outputColumn);
+  public <ClassName>(long value, int colNum, int outputColumnNum) {
+    super(value, colNum, outputColumnNum);
   }
 
   public <ClassName>() {

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/gen/vectorization/ExpressionTemplates/DateColumnArithmeticIntervalYearMonthColumn.txt
----------------------------------------------------------------------
diff --git a/ql/src/gen/vectorization/ExpressionTemplates/DateColumnArithmeticIntervalYearMonthColumn.txt b/ql/src/gen/vectorization/ExpressionTemplates/DateColumnArithmeticIntervalYearMonthColumn.txt
index 2a9f947..1ee059f 100644
--- a/ql/src/gen/vectorization/ExpressionTemplates/DateColumnArithmeticIntervalYearMonthColumn.txt
+++ b/ql/src/gen/vectorization/ExpressionTemplates/DateColumnArithmeticIntervalYearMonthColumn.txt
@@ -36,24 +36,26 @@ public class <ClassName> extends VectorExpression {
 
   private static final long serialVersionUID = 1L;
 
-  private int colNum1;
-  private int colNum2;
-  private int outputColumn;
-  private Date scratchDate1;
-  private HiveIntervalYearMonth scratchIntervalYearMonth2;
-  private Date outputDate;
-  private DateTimeMath dtm = new DateTimeMath();
-
-  public <ClassName>(int colNum1, int colNum2, int outputColumn) {
+  private final int colNum1;
+  private final int colNum2;
+
+  private transient final Date scratchDate1 = new Date(0);
+  private transient final HiveIntervalYearMonth scratchIntervalYearMonth2 = new HiveIntervalYearMonth();
+  private transient final Date outputDate = new Date(0);
+  private transient final DateTimeMath dtm = new DateTimeMath();
+
+  public <ClassName>(int colNum1, int colNum2, int outputColumnNum) {
+    super(outputColumnNum);
     this.colNum1 = colNum1;
     this.colNum2 = colNum2;
-    this.outputColumn = outputColumn;
-    scratchDate1 = new Date(0);
-    scratchIntervalYearMonth2 = new HiveIntervalYearMonth();
-    outputDate = new Date(0);
   }
 
   public <ClassName>() {
+    super();
+
+    // Dummy final assignments.
+    colNum1 = -1;
+    colNum2 = -1;
   }
 
   @Override
@@ -70,7 +72,7 @@ public class <ClassName> extends VectorExpression {
     LongColumnVector inputColVector2 = (LongColumnVector) batch.cols[colNum2];
 
     // Output is type date.
-    LongColumnVector outputColVector = (LongColumnVector) batch.cols[outputColumn];
+    LongColumnVector outputColVector = (LongColumnVector) batch.cols[outputColumnNum];
 
     int[] sel = batch.selected;
     int n = batch.size;
@@ -171,18 +173,8 @@ public class <ClassName> extends VectorExpression {
   }
 
   @Override
-  public int getOutputColumn() {
-    return outputColumn;
-  }
-
-  @Override
-  public String getOutputType() {
-    return "long";
-  }
-
-  @Override
   public String vectorExpressionParameters() {
-    return "col " + colNum1 + ", col " + + colNum2;
+    return getColumnParamString(0, colNum1) + ", " + getColumnParamString(1, colNum2);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/gen/vectorization/ExpressionTemplates/DateColumnArithmeticIntervalYearMonthScalar.txt
----------------------------------------------------------------------
diff --git a/ql/src/gen/vectorization/ExpressionTemplates/DateColumnArithmeticIntervalYearMonthScalar.txt b/ql/src/gen/vectorization/ExpressionTemplates/DateColumnArithmeticIntervalYearMonthScalar.txt
index 4bbc358..7dadd73 100644
--- a/ql/src/gen/vectorization/ExpressionTemplates/DateColumnArithmeticIntervalYearMonthScalar.txt
+++ b/ql/src/gen/vectorization/ExpressionTemplates/DateColumnArithmeticIntervalYearMonthScalar.txt
@@ -37,22 +37,25 @@ public class <ClassName> extends VectorExpression {
 
   private static final long serialVersionUID = 1L;
 
-  private int colNum;
-  private HiveIntervalYearMonth value;
-  private int outputColumn;
-  private Date scratchDate1;
-  private Date outputDate;
-  private DateTimeMath dtm = new DateTimeMath();
-
-  public <ClassName>(int colNum, long value, int outputColumn) {
+  private final int colNum;
+  private final HiveIntervalYearMonth value;
+
+  private transient final Date scratchDate1 = new Date(0);
+  private transient final Date outputDate = new Date(0);
+  private transient final DateTimeMath dtm = new DateTimeMath();
+
+  public <ClassName>(int colNum, long value, int outputColumnNum) {
+    super(outputColumnNum);
     this.colNum = colNum;
     this.value = new HiveIntervalYearMonth((int) value);
-    this.outputColumn = outputColumn;
-    scratchDate1 = new Date(0);
-    outputDate = new Date(0);
   }
 
   public <ClassName>() {
+    super();
+
+    // Dummy final assignments.
+    colNum = -1;
+    value = null;
   }
 
   @Override
@@ -66,7 +69,7 @@ public class <ClassName> extends VectorExpression {
     LongColumnVector inputColVector1 = (LongColumnVector) batch.cols[colNum];
 
     // Output is type date.
-    LongColumnVector outputColVector = (LongColumnVector) batch.cols[outputColumn];
+    LongColumnVector outputColVector = (LongColumnVector) batch.cols[outputColumnNum];
 
     int[] sel = batch.selected;
     boolean[] inputIsNull = inputColVector1.isNull;
@@ -131,18 +134,8 @@ public class <ClassName> extends VectorExpression {
   }
 
   @Override
-  public int getOutputColumn() {
-    return outputColumn;
-  }
-
-  @Override
-  public String getOutputType() {
-    return "long";
-  }
-
-  @Override
   public String vectorExpressionParameters() {
-    return "col " + colNum + ", val " + value;
+    return getColumnParamString(0, colNum) + ", val " + value;
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/gen/vectorization/ExpressionTemplates/DateColumnArithmeticTimestampColumn.txt
----------------------------------------------------------------------
diff --git a/ql/src/gen/vectorization/ExpressionTemplates/DateColumnArithmeticTimestampColumn.txt b/ql/src/gen/vectorization/ExpressionTemplates/DateColumnArithmeticTimestampColumn.txt
index 2e66b3a..29eabfd 100644
--- a/ql/src/gen/vectorization/ExpressionTemplates/DateColumnArithmeticTimestampColumn.txt
+++ b/ql/src/gen/vectorization/ExpressionTemplates/DateColumnArithmeticTimestampColumn.txt
@@ -37,20 +37,24 @@ public class <ClassName> extends VectorExpression {
 
   private static final long serialVersionUID = 1L;
 
-  private int colNum1;
-  private int colNum2;
-  private int outputColumn;
-  private Timestamp scratchTimestamp1;
-  private DateTimeMath dtm = new DateTimeMath();
+  private final int colNum1;
+  private final int colNum2;
 
-  public <ClassName>(int colNum1, int colNum2, int outputColumn) {
+  private transient final Timestamp scratchTimestamp1 = new Timestamp(0);
+  private transient final DateTimeMath dtm = new DateTimeMath();
+
+  public <ClassName>(int colNum1, int colNum2, int outputColumnNum) {
+    super(outputColumnNum);
     this.colNum1 = colNum1;
     this.colNum2 = colNum2;
-    this.outputColumn = outputColumn;
-    scratchTimestamp1 = new Timestamp(0);
   }
 
   public <ClassName>() {
+    super();
+
+    // Dummy final assignments.
+    colNum1 = -1;
+    colNum2 = -1;
   }
 
   @Override
@@ -67,7 +71,7 @@ public class <ClassName> extends VectorExpression {
     <InputColumnVectorType2> inputColVector2 = (<InputColumnVectorType2>) batch.cols[colNum2];
 
     // Output is type <ReturnType>.
-    <OutputColumnVectorType> outputColVector = (<OutputColumnVectorType>) batch.cols[outputColumn];
+    <OutputColumnVectorType> outputColVector = (<OutputColumnVectorType>) batch.cols[outputColumnNum];
 
     int[] sel = batch.selected;
     int n = batch.size;
@@ -160,18 +164,8 @@ public class <ClassName> extends VectorExpression {
   }
 
   @Override
-  public int getOutputColumn() {
-    return outputColumn;
-  }
-
-  @Override
-  public String getOutputType() {
-    return "<ReturnType>";
-  }
-
-  @Override
   public String vectorExpressionParameters() {
-    return "col " + colNum1 + ", col " + + colNum2;
+    return getColumnParamString(0, colNum1) + ", " + getColumnParamString(1, colNum2);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/gen/vectorization/ExpressionTemplates/DateColumnArithmeticTimestampScalar.txt
----------------------------------------------------------------------
diff --git a/ql/src/gen/vectorization/ExpressionTemplates/DateColumnArithmeticTimestampScalar.txt b/ql/src/gen/vectorization/ExpressionTemplates/DateColumnArithmeticTimestampScalar.txt
index e679449..67d748b 100644
--- a/ql/src/gen/vectorization/ExpressionTemplates/DateColumnArithmeticTimestampScalar.txt
+++ b/ql/src/gen/vectorization/ExpressionTemplates/DateColumnArithmeticTimestampScalar.txt
@@ -38,20 +38,24 @@ public class <ClassName> extends VectorExpression {
 
   private static final long serialVersionUID = 1L;
 
-  private int colNum;
-  private <HiveOperandType2> value;
-  private int outputColumn;
-  private Timestamp scratchTimestamp1;
-  private DateTimeMath dtm = new DateTimeMath();
+  private final int colNum;
+  private final <HiveOperandType2> value;
 
-  public <ClassName>(int colNum, <HiveOperandType2> value, int outputColumn) {
+  private transient final Timestamp scratchTimestamp1 = new Timestamp(0);
+  private transient final DateTimeMath dtm = new DateTimeMath();
+
+  public <ClassName>(int colNum, <HiveOperandType2> value, int outputColumnNum) {
+    super(outputColumnNum);
     this.colNum = colNum;
     this.value = value;
-    this.outputColumn = outputColumn;
-    scratchTimestamp1 = new Timestamp(0);
   }
 
   public <ClassName>() {
+    super();
+
+    // Dummy final assignments.
+    colNum = -1;
+    value = null;
   }
 
   @Override
@@ -65,7 +69,7 @@ public class <ClassName> extends VectorExpression {
     LongColumnVector inputColVector1 = (LongColumnVector) batch.cols[colNum];
 
     // Output is type <ReturnType>.
-    <OutputColumnVectorType> outputColVector = (<OutputColumnVectorType>) batch.cols[outputColumn];
+    <OutputColumnVectorType> outputColVector = (<OutputColumnVectorType>) batch.cols[outputColumnNum];
 
     int[] sel = batch.selected;
     boolean[] inputIsNull = inputColVector1.isNull;
@@ -129,18 +133,8 @@ public class <ClassName> extends VectorExpression {
   }
 
   @Override
-  public int getOutputColumn() {
-    return outputColumn;
-  }
-
-  @Override
-  public String getOutputType() {
-    return "<ReturnType>";
-  }
-
-  @Override
   public String vectorExpressionParameters() {
-    return "col " + colNum + ", val " + value.toString();
+    return getColumnParamString(0, colNum) + ", val " + value.toString();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/gen/vectorization/ExpressionTemplates/DateScalarArithmeticIntervalYearMonthColumn.txt
----------------------------------------------------------------------
diff --git a/ql/src/gen/vectorization/ExpressionTemplates/DateScalarArithmeticIntervalYearMonthColumn.txt b/ql/src/gen/vectorization/ExpressionTemplates/DateScalarArithmeticIntervalYearMonthColumn.txt
index e23dc27..8950794 100644
--- a/ql/src/gen/vectorization/ExpressionTemplates/DateScalarArithmeticIntervalYearMonthColumn.txt
+++ b/ql/src/gen/vectorization/ExpressionTemplates/DateScalarArithmeticIntervalYearMonthColumn.txt
@@ -46,22 +46,25 @@ public class <ClassName> extends VectorExpression {
 
   private static final long serialVersionUID = 1L;
 
-  private int colNum;
-  private Date value;
-  private int outputColumn;
-  private HiveIntervalYearMonth scratchIntervalYearMonth2;
-  private Date outputDate;
-  private DateTimeMath dtm = new DateTimeMath();
-
-  public <ClassName>(long value, int colNum, int outputColumn) {
-    this.colNum = colNum;
+  private final int colNum;
+  private final Date value;
+
+  private transient final HiveIntervalYearMonth scratchIntervalYearMonth2 = new HiveIntervalYearMonth();
+  private transient final Date outputDate = new Date(0);
+  private transient final DateTimeMath dtm = new DateTimeMath();
+
+  public <ClassName>(long value, int colNum, int outputColumnNum) {
+    super(outputColumnNum);
     this.value = new Date(DateWritable.daysToMillis((int) value));
-    this.outputColumn = outputColumn;
-    scratchIntervalYearMonth2 = new HiveIntervalYearMonth();
-    outputDate = new Date(0);
+    this.colNum = colNum;
   }
 
   public <ClassName>() {
+    super();
+
+    // Dummy final assignments.
+    value = null;
+    colNum = -1;
   }
 
   @Override
@@ -80,7 +83,7 @@ public class <ClassName> extends VectorExpression {
     LongColumnVector inputColVector2 = (LongColumnVector) batch.cols[colNum];
 
     // Output is type Date.
-    LongColumnVector outputColVector = (LongColumnVector) batch.cols[outputColumn];
+    LongColumnVector outputColVector = (LongColumnVector) batch.cols[outputColumnNum];
 
     int[] sel = batch.selected;
     boolean[] inputIsNull = inputColVector2.isNull;
@@ -145,18 +148,8 @@ public class <ClassName> extends VectorExpression {
   }
 
   @Override
-  public int getOutputColumn() {
-    return outputColumn;
-  }
-
-  @Override
-  public String getOutputType() {
-    return "long";
-  }
-
-  @Override
   public String vectorExpressionParameters() {
-    return "val " + value + ", col " + + colNum;
+    return "val " + value + ", " + getColumnParamString(1, colNum);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/gen/vectorization/ExpressionTemplates/DateScalarArithmeticTimestampColumn.txt
----------------------------------------------------------------------
diff --git a/ql/src/gen/vectorization/ExpressionTemplates/DateScalarArithmeticTimestampColumn.txt b/ql/src/gen/vectorization/ExpressionTemplates/DateScalarArithmeticTimestampColumn.txt
index 85d88fd..4b9614f 100644
--- a/ql/src/gen/vectorization/ExpressionTemplates/DateScalarArithmeticTimestampColumn.txt
+++ b/ql/src/gen/vectorization/ExpressionTemplates/DateScalarArithmeticTimestampColumn.txt
@@ -46,20 +46,25 @@ public class <ClassName> extends VectorExpression {
 
   private static final long serialVersionUID = 1L;
 
-  private int colNum;
-  private Timestamp value;
-  private int outputColumn;
-  private DateTimeMath dtm = new DateTimeMath();
+  private final Timestamp value;
+  private final int colNum;
 
-  public <ClassName>(long value, int colNum, int outputColumn) {
-    this.colNum = colNum;
+  private transient final DateTimeMath dtm = new DateTimeMath();
+
+  public <ClassName>(long value, int colNum, int outputColumnNum) {
+    super(outputColumnNum);
     // Scalar input #1 is type date (days).  For the math we convert it to a timestamp.
     this.value = new Timestamp(0);
     this.value.setTime(DateWritable.daysToMillis((int) value));
-    this.outputColumn = outputColumn;
+    this.colNum = colNum;
   }
 
   public <ClassName>() {
+    super();
+
+    // Dummy final assignments.
+    value = null;
+    colNum = -1;
   }
 
   @Override
@@ -78,7 +83,7 @@ public class <ClassName> extends VectorExpression {
     <InputColumnVectorType2> inputColVector2 = (<InputColumnVectorType2>) batch.cols[colNum];
 
     // Output is type <ReturnType>.
-    <OutputColumnVectorType> outputColVector = (<OutputColumnVectorType>) batch.cols[outputColumn];
+    <OutputColumnVectorType> outputColVector = (<OutputColumnVectorType>) batch.cols[outputColumnNum];
 
     int[] sel = batch.selected;
     boolean[] inputIsNull = inputColVector2.isNull;
@@ -136,18 +141,8 @@ public class <ClassName> extends VectorExpression {
   }
 
   @Override
-  public int getOutputColumn() {
-    return outputColumn;
-  }
-
-  @Override
-  public String getOutputType() {
-    return "<ReturnType>";
-  }
-
-  @Override
   public String vectorExpressionParameters() {
-    return "val " + value + ", col " + + colNum;
+    return "val " + value + ", " + getColumnParamString(1, colNum);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/gen/vectorization/ExpressionTemplates/Decimal64ColumnArithmeticDecimal64Column.txt
----------------------------------------------------------------------
diff --git a/ql/src/gen/vectorization/ExpressionTemplates/Decimal64ColumnArithmeticDecimal64Column.txt b/ql/src/gen/vectorization/ExpressionTemplates/Decimal64ColumnArithmeticDecimal64Column.txt
new file mode 100644
index 0000000..a5247c4
--- /dev/null
+++ b/ql/src/gen/vectorization/ExpressionTemplates/Decimal64ColumnArithmeticDecimal64Column.txt
@@ -0,0 +1,203 @@
+/**
+ * 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.gen;
+
+import org.apache.hadoop.hive.ql.exec.vector.Decimal64ColumnVector;
+import org.apache.hadoop.hive.ql.exec.vector.VectorExpressionDescriptor;
+import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.Decimal64Util;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression;
+import org.apache.hadoop.hive.serde2.io.HiveDecimalWritable;
+
+/**
+ * Generated from template Decimal64ColumnArithmeticDecimal64Column.txt, which covers
+ * decimal64 arithmetic expressions between columns.
+ */
+public class <ClassName> extends VectorExpression {
+
+  private static final long serialVersionUID = 1L;
+
+  private final int colNum1;
+  private final int colNum2;
+
+  public <ClassName>(int colNum1, int colNum2, int outputColumnNum) {
+    super(outputColumnNum);
+    this.colNum1 = colNum1;
+    this.colNum2 = colNum2;
+  }
+
+  public <ClassName>() {
+    super();
+
+    // Dummy final assignments.
+    colNum1 = -1;
+    colNum2 = -1;
+  }
+
+  @Override
+  public void evaluate(VectorizedRowBatch batch) {
+
+    if (childExpressions != null) {
+      super.evaluateChildren(batch);
+    }
+
+    Decimal64ColumnVector inputColVector1 = (Decimal64ColumnVector) batch.cols[colNum1];
+    Decimal64ColumnVector inputColVector2 = (Decimal64ColumnVector) batch.cols[colNum2];
+    Decimal64ColumnVector outputColVector = (Decimal64ColumnVector) batch.cols[outputColumnNum];
+    int[] sel = batch.selected;
+    int n = batch.size;
+    long[] vector1 = inputColVector1.vector;
+    long[] vector2 = inputColVector2.vector;
+    long[] outputVector = outputColVector.vector;
+    boolean[] outputIsNull = outputColVector.isNull;
+
+    // return immediately if batch is empty
+    if (n == 0) {
+      return;
+    }
+
+    final long outputDecimal64AbsMax =
+        HiveDecimalWritable.getDecimal64AbsMax(outputColVector.precision);
+
+    outputColVector.isRepeating =
+         inputColVector1.isRepeating && inputColVector2.isRepeating
+      || inputColVector1.isRepeating && !inputColVector1.noNulls && inputColVector1.isNull[0]
+      || inputColVector2.isRepeating && !inputColVector2.noNulls && inputColVector2.isNull[0];
+
+    if (inputColVector1.noNulls && inputColVector2.noNulls) {
+
+      /*
+       * Initialize output vector NULL values to false. This is necessary
+       * since the decimal operation may produce a NULL result even for
+       * a non-null input vector value, and convert the output vector
+       * to have noNulls = false;
+       */
+      NullUtil.initOutputNullsToFalse(outputColVector,
+          inputColVector1.isRepeating && inputColVector2.isRepeating,
+          batch.selectedInUse, sel, n);
+    }
+
+    // Handle nulls first
+    NullUtil.propagateNullsColCol(
+        inputColVector1, inputColVector2, outputColVector, sel, n, batch.selectedInUse);
+
+    /*
+     * Disregard nulls for processing. In other words,
+     * the arithmetic operation is performed even if one or
+     * more inputs are null. This is to improve speed by avoiding
+     * conditional checks in the inner loop.
+     */
+    if (inputColVector1.isRepeating && inputColVector2.isRepeating) {
+      final long result = vector1[0] <OperatorSymbol> vector2[0];
+      outputVector[0] = result;
+      if (Math.abs(result) > outputDecimal64AbsMax) {
+        outputColVector.noNulls = false;
+        outputIsNull[0] = true;
+      }
+    } else if (inputColVector1.isRepeating) {
+      final long repeatedValue1 = vector1[0];
+      if (batch.selectedInUse) {
+        for(int j = 0; j != n; j++) {
+          int i = sel[j];
+          final long result = repeatedValue1 <OperatorSymbol> vector2[i];
+          outputVector[i] = result;
+          if (Math.abs(result) > outputDecimal64AbsMax) {
+            outputColVector.noNulls = false;
+            outputIsNull[i] = true;
+          }
+        }
+      } else {
+        for(int i = 0; i != n; i++) {
+          final long result = repeatedValue1 <OperatorSymbol> vector2[i];
+          outputVector[i] = result;
+          if (Math.abs(result) > outputDecimal64AbsMax) {
+            outputColVector.noNulls = false;
+            outputIsNull[i] = true;
+          }
+        }
+      }
+    } else if (inputColVector2.isRepeating) {
+      final long repeatedValue2 = vector2[0];
+      if (batch.selectedInUse) {
+        for(int j = 0; j != n; j++) {
+          int i = sel[j];
+          final long result = vector1[i] <OperatorSymbol> repeatedValue2;
+          outputVector[i] = result;
+          if (Math.abs(result) > outputDecimal64AbsMax) {
+            outputColVector.noNulls = false;
+            outputIsNull[i] = true;
+          }
+        }
+      } else {
+        for(int i = 0; i != n; i++) {
+          final long result = vector1[i] <OperatorSymbol> repeatedValue2;
+          outputVector[i] = result;
+          if (Math.abs(result) > outputDecimal64AbsMax) {
+            outputColVector.noNulls = false;
+            outputIsNull[i] = true;
+          }
+        }
+      }
+    } else {
+      if (batch.selectedInUse) {
+        for(int j = 0; j != n; j++) {
+          int i = sel[j];
+          final long result = vector1[i] <OperatorSymbol> vector2[i];
+          outputVector[i] = result;
+          if (Math.abs(result) > outputDecimal64AbsMax) {
+            outputColVector.noNulls = false;
+            outputIsNull[i] = true;
+          }
+        }
+      } else {
+        for(int i = 0; i != n; i++) {
+          final long result = vector1[i] <OperatorSymbol> vector2[i];
+          outputVector[i] = result;
+          if (Math.abs(result) > outputDecimal64AbsMax) {
+            outputColVector.noNulls = false;
+            outputIsNull[i] = true;
+          }
+        }
+      }
+    }
+
+    // Currently, we defer division, etc to regular HiveDecimal so we don't do any null
+    // default value setting here.
+  }
+
+  @Override
+  public String vectorExpressionParameters() {
+    return getColumnParamString(0, colNum1) + ", " + getColumnParamString(1, colNum2);
+  }
+
+  @Override
+  public VectorExpressionDescriptor.Descriptor getDescriptor() {
+    return (new VectorExpressionDescriptor.Builder())
+        .setMode(
+            VectorExpressionDescriptor.Mode.PROJECTION)
+        .setNumArguments(2)
+        .setArgumentTypes(
+            VectorExpressionDescriptor.ArgumentType.DECIMAL_64,
+            VectorExpressionDescriptor.ArgumentType.DECIMAL_64)
+        .setInputExpressionTypes(
+            VectorExpressionDescriptor.InputExpressionType.COLUMN,
+            VectorExpressionDescriptor.InputExpressionType.COLUMN).build();
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/gen/vectorization/ExpressionTemplates/Decimal64ColumnArithmeticDecimal64Scalar.txt
----------------------------------------------------------------------
diff --git a/ql/src/gen/vectorization/ExpressionTemplates/Decimal64ColumnArithmeticDecimal64Scalar.txt b/ql/src/gen/vectorization/ExpressionTemplates/Decimal64ColumnArithmeticDecimal64Scalar.txt
new file mode 100644
index 0000000..f8647b2
--- /dev/null
+++ b/ql/src/gen/vectorization/ExpressionTemplates/Decimal64ColumnArithmeticDecimal64Scalar.txt
@@ -0,0 +1,180 @@
+/**
+ * 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.gen;
+
+import org.apache.hadoop.hive.ql.exec.vector.Decimal64ColumnVector;
+import org.apache.hadoop.hive.ql.exec.vector.VectorExpressionDescriptor;
+import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.Decimal64Util;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression;
+import org.apache.hadoop.hive.serde2.io.HiveDecimalWritable;
+import org.apache.hadoop.hive.serde2.typeinfo.DecimalTypeInfo;
+
+/**
+ * Generated from template ColumnArithmeticScalar.txt, which covers decimal64 arithmetic
+ * expressions between a column and a scalar.
+ */
+public class <ClassName> extends VectorExpression {
+
+  private static final long serialVersionUID = 1L;
+
+  private final int colNum;
+  private final long value;
+
+  public <ClassName>(int colNum, long value, int outputColumnNum) {
+    super(outputColumnNum);
+    this.colNum = colNum;
+    this.value = value;
+  }
+
+  public <ClassName>() {
+    super();
+
+    // Dummy final assignments.
+    colNum = -1;
+    value = 0;
+  }
+
+  @Override
+  public void evaluate(VectorizedRowBatch batch) {
+
+    if (childExpressions != null) {
+      super.evaluateChildren(batch);
+    }
+
+    Decimal64ColumnVector inputColVector = (Decimal64ColumnVector) batch.cols[colNum];
+    Decimal64ColumnVector outputColVector = (Decimal64ColumnVector) batch.cols[outputColumnNum];
+    int[] sel = batch.selected;
+    boolean[] inputIsNull = inputColVector.isNull;
+    boolean[] outputIsNull = outputColVector.isNull;
+    outputColVector.noNulls = inputColVector.noNulls;
+    outputColVector.isRepeating = inputColVector.isRepeating;
+    int n = batch.size;
+    long[] vector = inputColVector.vector;
+    long[] outputVector = outputColVector.vector;
+
+    // return immediately if batch is empty
+    if (n == 0) {
+      return;
+    }
+
+    final long outputDecimal64AbsMax =
+        HiveDecimalWritable.getDecimal64AbsMax(outputColVector.precision);
+
+    if (inputColVector.noNulls) {
+
+      /*
+       * Initialize output vector NULL values to false. This is necessary
+       * since the decimal operation may produce a NULL result even for
+       * a non-null input vector value, and convert the output vector
+       * to have noNulls = false;
+       */
+      NullUtil.initOutputNullsToFalse(outputColVector, inputColVector.isRepeating,
+          batch.selectedInUse, sel, n);
+    }
+
+    if (inputColVector.isRepeating) {
+      if (!inputColVector.noNulls) {
+        outputIsNull[0] = inputIsNull[0];
+      }
+      // The following may override a "false" null setting if an error or overflow occurs.
+      final long result = vector[0] <OperatorSymbol> value;
+      outputVector[0] = result;
+      if (Math.abs(result) > outputDecimal64AbsMax) {
+        outputColVector.noNulls = false;
+        outputIsNull[0] = true;
+      }
+    } else if (inputColVector.noNulls) {
+      if (batch.selectedInUse) {
+        for(int j = 0; j != n; j++) {
+          int i = sel[j];
+          final long result = vector[i] <OperatorSymbol> value;
+          outputVector[i] = result;
+          if (Math.abs(result) > outputDecimal64AbsMax) {
+            outputColVector.noNulls = false;
+            outputIsNull[i] = true;
+          }
+        }
+      } else {
+        for(int i = 0; i != n; i++) {
+          final long result = vector[i] <OperatorSymbol> value;
+          outputVector[i] = result;
+          if (Math.abs(result) > outputDecimal64AbsMax) {
+            outputColVector.noNulls = false;
+            outputIsNull[i] = true;
+          }
+        }
+      }
+    } else /* there are nulls */ {
+      if (batch.selectedInUse) {
+        for(int j = 0; j != n; j++) {
+          int i = sel[j];
+          outputIsNull[i] = inputIsNull[i];
+
+          // The following may override a "false" null setting if an error or overflow occurs.
+          final long result = vector[i] <OperatorSymbol> value;
+          outputVector[i] = result;
+          if (Math.abs(result) > outputDecimal64AbsMax) {
+            outputColVector.noNulls = false;
+            outputIsNull[i] = true;
+          }
+        }
+      } else {
+        System.arraycopy(inputIsNull, 0, outputIsNull, 0, n);
+        for(int i = 0; i != n; i++) {
+
+          // The following may override a "false" null setting if an error or overflow occurs.
+          final long result = vector[i] <OperatorSymbol> value;
+          outputVector[i] = result;
+          if (Math.abs(result) > outputDecimal64AbsMax) {
+            outputColVector.noNulls = false;
+            outputIsNull[i] = true;
+          }
+        }
+      }
+    }
+
+    // Currently, we defer division, etc to regular HiveDecimal so we don't do any null
+    // default value setting here.
+  }
+
+  @Override
+  public String vectorExpressionParameters() {
+    DecimalTypeInfo decimalTypeInfo = (DecimalTypeInfo) inputTypeInfos[0];
+    HiveDecimalWritable writable = new HiveDecimalWritable();
+    writable.deserialize64(value, decimalTypeInfo.scale());
+    return getColumnParamString(0, colNum) + ", decimal64Val " + value +
+        ", decimalVal " + writable.toString();
+  }
+
+  @Override
+  public VectorExpressionDescriptor.Descriptor getDescriptor() {
+    return (new VectorExpressionDescriptor.Builder())
+        .setMode(
+            VectorExpressionDescriptor.Mode.PROJECTION)
+        .setNumArguments(2)
+        .setArgumentTypes(
+            VectorExpressionDescriptor.ArgumentType.DECIMAL_64,
+            VectorExpressionDescriptor.ArgumentType.DECIMAL_64)
+        .setInputExpressionTypes(
+            VectorExpressionDescriptor.InputExpressionType.COLUMN,
+            VectorExpressionDescriptor.InputExpressionType.SCALAR).build();
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/gen/vectorization/ExpressionTemplates/Decimal64ScalarArithmeticDecimal64Column.txt
----------------------------------------------------------------------
diff --git a/ql/src/gen/vectorization/ExpressionTemplates/Decimal64ScalarArithmeticDecimal64Column.txt b/ql/src/gen/vectorization/ExpressionTemplates/Decimal64ScalarArithmeticDecimal64Column.txt
new file mode 100644
index 0000000..7b1c245
--- /dev/null
+++ b/ql/src/gen/vectorization/ExpressionTemplates/Decimal64ScalarArithmeticDecimal64Column.txt
@@ -0,0 +1,181 @@
+/**
+ * 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.gen;
+
+import org.apache.hadoop.hive.ql.exec.vector.Decimal64ColumnVector;
+import org.apache.hadoop.hive.ql.exec.vector.VectorExpressionDescriptor;
+import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.Decimal64Util;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression;
+import org.apache.hadoop.hive.serde2.io.HiveDecimalWritable;
+import org.apache.hadoop.hive.serde2.typeinfo.DecimalTypeInfo;
+
+/**
+ * Generated from template Decimal64ScalarArithmeticDecimal64Column.txt.
+ * Implements a vectorized arithmetic operator with a scalar on the left and a
+ * column vector on the right. The result is output to an output column vector.
+ */
+public class <ClassName> extends VectorExpression {
+
+  private static final long serialVersionUID = 1L;
+
+  private int colNum;
+  private long value;
+
+  public <ClassName>(long value, int colNum, int outputColumnNum) {
+    super(outputColumnNum);
+    this.colNum = colNum;
+    this.value = value;
+  }
+
+  public <ClassName>() {
+    super();
+
+    // Dummy final assignments.
+    colNum = -1;
+    value = 0;
+  }
+
+  @Override
+  public void evaluate(VectorizedRowBatch batch) {
+
+    if (childExpressions != null) {
+      super.evaluateChildren(batch);
+    }
+
+    Decimal64ColumnVector inputColVector = (Decimal64ColumnVector) batch.cols[colNum];
+    Decimal64ColumnVector outputColVector = (Decimal64ColumnVector) batch.cols[outputColumnNum];
+    int[] sel = batch.selected;
+    boolean[] inputIsNull = inputColVector.isNull;
+    boolean[] outputIsNull = outputColVector.isNull;
+    outputColVector.noNulls = inputColVector.noNulls;
+    outputColVector.isRepeating = inputColVector.isRepeating;
+    int n = batch.size;
+    long[] vector = inputColVector.vector;
+    long[] outputVector = outputColVector.vector;
+
+    // return immediately if batch is empty
+    if (n == 0) {
+      return;
+    }
+
+    final long outputDecimal64AbsMax =
+        HiveDecimalWritable.getDecimal64AbsMax(outputColVector.precision);
+
+    if (inputColVector.noNulls) {
+
+      /* Initialize output vector NULL values to false. This is necessary
+       * since the decimal operation may produce a NULL result even for
+       * a non-null input vector value, and convert the output vector
+       * to have noNulls = false;
+       */
+      NullUtil.initOutputNullsToFalse(outputColVector, inputColVector.isRepeating,
+          batch.selectedInUse, sel, n);
+    }
+
+    if (inputColVector.isRepeating) {
+      if (!inputColVector.noNulls) {
+        outputIsNull[0] = inputIsNull[0];
+      }
+
+      // The following may override a "false" null setting if an error or overflow occurs.
+      final long result = value <OperatorSymbol> vector[0];
+      outputVector[0] = result;
+      if (Math.abs(result) > outputDecimal64AbsMax) {
+        outputColVector.noNulls = false;
+        outputIsNull[0] = true;
+      }
+    } else if (inputColVector.noNulls) {
+      if (batch.selectedInUse) {
+        for(int j = 0; j != n; j++) {
+          int i = sel[j];
+          final long result = value <OperatorSymbol> vector[i];
+          outputVector[i] = result;
+          if (Math.abs(result) > outputDecimal64AbsMax) {
+            outputColVector.noNulls = false;
+            outputIsNull[i] = true;
+          }
+        }
+      } else {
+        for(int i = 0; i != n; i++) {
+          final long result = value <OperatorSymbol> vector[i];
+          outputVector[i] = result;
+          if (Math.abs(result) > outputDecimal64AbsMax) {
+            outputColVector.noNulls = false;
+            outputIsNull[i] = true;
+          }
+        }
+      }
+    } else /* there are nulls */ {
+      if (batch.selectedInUse) {
+        for(int j = 0; j != n; j++) {
+          int i = sel[j];
+          outputIsNull[i] = inputIsNull[i];
+
+          // The following may override a "false" null setting if an error or overflow occurs.
+          final long result = value <OperatorSymbol> vector[i];
+          outputVector[i] = result;
+          if (Math.abs(result) > outputDecimal64AbsMax) {
+            outputColVector.noNulls = false;
+            outputIsNull[i] = true;
+          }
+        }
+      } else {
+        System.arraycopy(inputIsNull, 0, outputIsNull, 0, n);
+        for(int i = 0; i != n; i++) {
+
+          // The following may override a "false" null setting if an error or overflow occurs.
+          final long result = value <OperatorSymbol> vector[i];
+          outputVector[i] = result;
+          if (Math.abs(result) > outputDecimal64AbsMax) {
+            outputColVector.noNulls = false;
+            outputIsNull[i] = true;
+          }
+        }
+      }
+    }
+
+    // Currently, we defer division, etc to regular HiveDecimal so we don't do any null
+    // default value setting here.
+  }
+
+  @Override
+  public String vectorExpressionParameters() {
+    DecimalTypeInfo decimalTypeInfo = (DecimalTypeInfo) inputTypeInfos[1];
+    HiveDecimalWritable writable = new HiveDecimalWritable();
+    writable.deserialize64(value, decimalTypeInfo.scale());
+    return "decimal64Val " + value + ", decimalVal " + writable.toString() +
+        ", " + getColumnParamString(1, colNum);
+  }
+
+  @Override
+  public VectorExpressionDescriptor.Descriptor getDescriptor() {
+    return (new VectorExpressionDescriptor.Builder())
+        .setMode(
+            VectorExpressionDescriptor.Mode.PROJECTION)
+        .setNumArguments(2)
+        .setArgumentTypes(
+            VectorExpressionDescriptor.ArgumentType.DECIMAL_64,
+            VectorExpressionDescriptor.ArgumentType.DECIMAL_64)
+        .setInputExpressionTypes(
+            VectorExpressionDescriptor.InputExpressionType.SCALAR,
+            VectorExpressionDescriptor.InputExpressionType.COLUMN).build();
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/gen/vectorization/ExpressionTemplates/DecimalColumnUnaryFunc.txt
----------------------------------------------------------------------
diff --git a/ql/src/gen/vectorization/ExpressionTemplates/DecimalColumnUnaryFunc.txt b/ql/src/gen/vectorization/ExpressionTemplates/DecimalColumnUnaryFunc.txt
index 0b7fefc..50c9996 100644
--- a/ql/src/gen/vectorization/ExpressionTemplates/DecimalColumnUnaryFunc.txt
+++ b/ql/src/gen/vectorization/ExpressionTemplates/DecimalColumnUnaryFunc.txt
@@ -32,17 +32,18 @@ import java.util.Arrays;
 public class <ClassName> extends VectorExpression {
   private static final long serialVersionUID = 1L;
 
-  private int colNum;
-  private int outputColumn;
+  private final int colNum;
 
-  public <ClassName>(int colNum, int outputColumn) {
-    this();
+  public <ClassName>(int colNum, int outputColumnNum) {
+    super(outputColumnNum);
     this.colNum = colNum;
-    this.outputColumn = outputColumn;
   }
-  
+
   public <ClassName>() {
     super();
+
+    // Dummy final assignments.
+    colNum = -1;
   }
 
   @Override
@@ -53,7 +54,7 @@ public class <ClassName> extends VectorExpression {
     }
 
     DecimalColumnVector inputColVector = (DecimalColumnVector) batch.cols[colNum];
-    <OutputColumnVectorType> outputColVector = (<OutputColumnVectorType>) batch.cols[outputColumn];
+    <OutputColumnVectorType> outputColVector = (<OutputColumnVectorType>) batch.cols[outputColumnNum];
     int[] sel = batch.selected;
     boolean[] inputIsNull = inputColVector.isNull;
     boolean[] outputIsNull = outputColVector.isNull;
@@ -109,18 +110,8 @@ public class <ClassName> extends VectorExpression {
   }
 
   @Override
-  public int getOutputColumn() {
-    return outputColumn;
-  }
-  
-  @Override
-  public String getOutputType() {
-    return outputType;
-  }
-
-  @Override
   public String vectorExpressionParameters() {
-    return "col " + colNum;
+    return getColumnParamString(0, colNum);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/gen/vectorization/ExpressionTemplates/FilterColumnBetween.txt
----------------------------------------------------------------------
diff --git a/ql/src/gen/vectorization/ExpressionTemplates/FilterColumnBetween.txt b/ql/src/gen/vectorization/ExpressionTemplates/FilterColumnBetween.txt
index aabd20f..c6c46f3 100644
--- a/ql/src/gen/vectorization/ExpressionTemplates/FilterColumnBetween.txt
+++ b/ql/src/gen/vectorization/ExpressionTemplates/FilterColumnBetween.txt
@@ -33,19 +33,25 @@ public class <ClassName> extends VectorExpression {
 
   private static final long serialVersionUID = 1L;
 
-  private int colNum;
-  
-  // The comparison is of the form "column BETWEEN leftValue AND rightValue"
+  private final int colNum;
+
+  // The comparison is of the form "column BETWEEN leftValue AND rightValue".
+  // NOTE: These can be set later by FilterColumnBetweenDynamicValue.txt so they are not final.
   private <OperandType> leftValue;
   private <OperandType> rightValue;
 
-  public <ClassName>(int colNum, <OperandType> leftValue, <OperandType> rightValue) { 
+  public <ClassName>(int colNum, <OperandType> leftValue, <OperandType> rightValue) {
+    super();
     this.colNum = colNum;
     this.leftValue = leftValue;
     this.rightValue = rightValue;
   }
 
   public <ClassName>() {
+    super();
+
+    // Dummy final assignments.
+    colNum = -1;
   }
 
   @Override
@@ -140,24 +146,6 @@ public class <ClassName> extends VectorExpression {
     }
   }
 
-  @Override
-  public int getOutputColumn() {
-    return -1;
-  }
-
-  @Override
-  public String getOutputType() {
-    return "boolean";
-  }
-  
-  public int getColNum() {
-    return colNum;
-  }
-
-  public void setColNum(int colNum) {
-    this.colNum = colNum;
-  }
-
   public <OperandType> getLeftValue() {
     return leftValue;
   }
@@ -165,7 +153,7 @@ public class <ClassName> extends VectorExpression {
   public void setLeftValue(<OperandType> value) {
     this.leftValue = value;
   }
-  
+
   public <OperandType> getRightValue() {
     return rightValue;
   }
@@ -176,7 +164,7 @@ public class <ClassName> extends VectorExpression {
 
   @Override
   public String vectorExpressionParameters() {
-    return "col " + colNum + ", left " + leftValue + ", right " + rightValue;
+    return getColumnParamString(0, colNum) + ", left " + leftValue + ", right " + rightValue;
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/gen/vectorization/ExpressionTemplates/FilterColumnBetweenDynamicValue.txt
----------------------------------------------------------------------
diff --git a/ql/src/gen/vectorization/ExpressionTemplates/FilterColumnBetweenDynamicValue.txt b/ql/src/gen/vectorization/ExpressionTemplates/FilterColumnBetweenDynamicValue.txt
index 9d5432f..6b5a367 100644
--- a/ql/src/gen/vectorization/ExpressionTemplates/FilterColumnBetweenDynamicValue.txt
+++ b/ql/src/gen/vectorization/ExpressionTemplates/FilterColumnBetweenDynamicValue.txt
@@ -30,6 +30,7 @@ import java.sql.Timestamp;
 import org.apache.hadoop.hive.common.type.HiveChar;
 import org.apache.hadoop.hive.common.type.HiveDecimal;
 import org.apache.hadoop.hive.common.type.HiveVarchar;
+import org.apache.hadoop.hive.ql.metadata.HiveException;
 
 public class <ClassName> extends Filter<TypeName>ColumnBetween {
 
@@ -37,10 +38,12 @@ public class <ClassName> extends Filter<TypeName>ColumnBetween {
 
   private static final Logger LOG = LoggerFactory.getLogger(<ClassName>.class);
 
-  protected DynamicValue leftDynamicValue;
-  protected DynamicValue rightDynamicValue;
-  protected transient boolean initialized = false;
-  protected transient boolean isLeftOrRightNull = false;
+  protected final DynamicValue leftDynamicValue;
+  protected final DynamicValue rightDynamicValue;
+
+  // Transient members initialized by transientInit method.
+  protected transient boolean initialized;
+  protected transient boolean isLeftOrRightNull;
 
   public <ClassName>(int colNum, DynamicValue leftValue, DynamicValue rightValue) {
     super(colNum, <DefaultValue>, <DefaultValue>);
@@ -49,24 +52,29 @@ public class <ClassName> extends Filter<TypeName>ColumnBetween {
   }
 
   public <ClassName>() {
+    super();
+
+    // Dummy final assignments.
+    leftDynamicValue = null;
+    rightDynamicValue = null;
   }
 
-  public DynamicValue getLeftDynamicValue() {
-    return leftDynamicValue;
+  @Override
+  public void transientInit() throws HiveException {
+    super.transientInit();
+
+    initialized = false;
+    isLeftOrRightNull = false;
   }
 
-  public void setLeftDynamicValue(DynamicValue leftValue) {
-    this.leftDynamicValue = leftValue;
+  public DynamicValue getLeftDynamicValue() {
+    return leftDynamicValue;
   }
 
   public DynamicValue getRightDynamicValue() {
     return rightDynamicValue;
   }
 
-  public void getRightDynamicValue(DynamicValue rightValue) {
-    this.rightDynamicValue = rightValue;
-  }
-
   @Override
   public void init(Configuration conf) {
     super.init(conf);

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/gen/vectorization/ExpressionTemplates/FilterColumnCompareColumn.txt
----------------------------------------------------------------------
diff --git a/ql/src/gen/vectorization/ExpressionTemplates/FilterColumnCompareColumn.txt b/ql/src/gen/vectorization/ExpressionTemplates/FilterColumnCompareColumn.txt
index ee80606..ab8b786 100644
--- a/ql/src/gen/vectorization/ExpressionTemplates/FilterColumnCompareColumn.txt
+++ b/ql/src/gen/vectorization/ExpressionTemplates/FilterColumnCompareColumn.txt
@@ -33,15 +33,21 @@ public class <ClassName> extends VectorExpression {
 
   private static final long serialVersionUID = 1L;
 
-  protected int colNum1;
-  protected int colNum2;
+  protected final int colNum1;
+  protected final int colNum2;
 
-  public <ClassName>(int colNum1, int colNum2) { 
+  public <ClassName>(int colNum1, int colNum2) {
+    super();
     this.colNum1 = colNum1;
     this.colNum2 = colNum2;
   }
 
   public <ClassName>() {
+    super();
+
+    // Dummy final assignments.
+    colNum1 = -1;
+    colNum2 = -1;
   }
 
   @Override
@@ -156,34 +162,8 @@ public class <ClassName> extends VectorExpression {
   }
 
   @Override
-  public String getOutputType() {
-    return "boolean";
-  }
-
-  @Override
-  public int getOutputColumn() {
-    return -1;
-  }
-  
-  public int getColNum1() {
-    return colNum1;
-  }
-
-  public void setColNum1(int colNum1) {
-    this.colNum1 = colNum1;
-  }
-
-  public int getColNum2() {
-    return colNum2;
-  }
-
-  public void setColNum2(int colNum2) {
-    this.colNum2 = colNum2;
-  }
-
-  @Override
   public String vectorExpressionParameters() {
-    return "col " + colNum1 + ", col " + + colNum2;
+    return getColumnParamString(0, colNum1) + ", " + getColumnParamString(1, colNum2);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/gen/vectorization/ExpressionTemplates/FilterColumnCompareScalar.txt
----------------------------------------------------------------------
diff --git a/ql/src/gen/vectorization/ExpressionTemplates/FilterColumnCompareScalar.txt b/ql/src/gen/vectorization/ExpressionTemplates/FilterColumnCompareScalar.txt
index 248a66a..eee33e7 100644
--- a/ql/src/gen/vectorization/ExpressionTemplates/FilterColumnCompareScalar.txt
+++ b/ql/src/gen/vectorization/ExpressionTemplates/FilterColumnCompareScalar.txt
@@ -32,15 +32,20 @@ public class <ClassName> extends VectorExpression {
 
   private static final long serialVersionUID = 1L;
 
-  protected int colNum;
-  protected <OperandType2> value;
+  protected final int colNum;
+  protected final <OperandType2> value;
 
-  public <ClassName>(int colNum, <OperandType2> value) { 
+  public <ClassName>(int colNum, <OperandType2> value) {
     this.colNum = colNum;
     this.value = value;
   }
 
   public <ClassName>() {
+    super();
+
+    // Dummy final assignments.
+    colNum = -1;
+    value = 0;
   }
 
   @Override
@@ -132,34 +137,8 @@ public class <ClassName> extends VectorExpression {
   }
 
   @Override
-  public int getOutputColumn() {
-    return -1;
-  }
-
-  @Override
-  public String getOutputType() {
-    return "boolean";
-  }
-  
-  public int getColNum() {
-    return colNum;
-  }
-
-  public void setColNum(int colNum) {
-    this.colNum = colNum;
-  }
-
-  public <OperandType2> getValue() {
-    return value;
-  }
-
-  public void setValue(<OperandType2> value) {
-    this.value = value;
-  }
-
-  @Override
   public String vectorExpressionParameters() {
-    return "col " + colNum + ", val " + value;
+    return getColumnParamString(0, colNum) + ", val " + value;
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/gen/vectorization/ExpressionTemplates/FilterDecimal64ColumnCompareDecimal64Column.txt
----------------------------------------------------------------------
diff --git a/ql/src/gen/vectorization/ExpressionTemplates/FilterDecimal64ColumnCompareDecimal64Column.txt b/ql/src/gen/vectorization/ExpressionTemplates/FilterDecimal64ColumnCompareDecimal64Column.txt
new file mode 100644
index 0000000..4f520ed
--- /dev/null
+++ b/ql/src/gen/vectorization/ExpressionTemplates/FilterDecimal64ColumnCompareDecimal64Column.txt
@@ -0,0 +1,54 @@
+/**
+ * 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.gen;
+
+import org.apache.hadoop.hive.ql.exec.vector.VectorExpressionDescriptor;
+
+/**
+ * Generated from template FilterDecimal64ColumnCompareDecimal64Column.txt, which covers
+ * decimal64 comparison expressions between two columns, however output is not produced in
+ * a separate column. The selected vector of the input {@link VectorizedRowBatch} is updated
+ * for in-place filtering.
+ */
+public class <ClassName> extends <BaseClassName> {
+
+  private static final long serialVersionUID = 1L;
+
+  public <ClassName>(int colNum1, int colNum2) {
+    super(colNum1, colNum2);
+  }
+
+  public <ClassName>() {
+    super();
+  }
+
+  @Override
+  public VectorExpressionDescriptor.Descriptor getDescriptor() {
+    return (new VectorExpressionDescriptor.Builder())
+        .setMode(
+            VectorExpressionDescriptor.Mode.FILTER)
+        .setNumArguments(2)
+        .setArgumentTypes(
+            VectorExpressionDescriptor.ArgumentType.DECIMAL_64,
+            VectorExpressionDescriptor.ArgumentType.DECIMAL_64)
+        .setInputExpressionTypes(
+            VectorExpressionDescriptor.InputExpressionType.COLUMN,
+            VectorExpressionDescriptor.InputExpressionType.COLUMN).build();
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/gen/vectorization/ExpressionTemplates/FilterDecimal64ColumnCompareDecimal64Scalar.txt
----------------------------------------------------------------------
diff --git a/ql/src/gen/vectorization/ExpressionTemplates/FilterDecimal64ColumnCompareDecimal64Scalar.txt b/ql/src/gen/vectorization/ExpressionTemplates/FilterDecimal64ColumnCompareDecimal64Scalar.txt
new file mode 100644
index 0000000..71c7962
--- /dev/null
+++ b/ql/src/gen/vectorization/ExpressionTemplates/FilterDecimal64ColumnCompareDecimal64Scalar.txt
@@ -0,0 +1,54 @@
+/**
+ * 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.gen;
+
+import org.apache.hadoop.hive.ql.exec.vector.VectorExpressionDescriptor;
+
+/**
+ * Generated from template FilterDecimal64ColumnCompareDecimal64Scalar.txt, which covers decimal64
+ * comparison  expressions between a column and a scalar, however output is not produced in a
+ * separate column. The selected vector of the input {@link VectorizedRowBatch} is updated for
+ * in-place filtering.
+ */
+public class <ClassName> extends <BaseClassName> {
+
+  private static final long serialVersionUID = 1L;
+
+  public <ClassName>(int colNum, long value) {
+    super(colNum, value);
+  }
+
+  public <ClassName>() {
+    super();
+  }
+
+  @Override
+  public VectorExpressionDescriptor.Descriptor getDescriptor() {
+    return (new VectorExpressionDescriptor.Builder())
+        .setMode(
+            VectorExpressionDescriptor.Mode.FILTER)
+        .setNumArguments(2)
+        .setArgumentTypes(
+            VectorExpressionDescriptor.ArgumentType.DECIMAL_64,
+            VectorExpressionDescriptor.ArgumentType.DECIMAL_64)
+        .setInputExpressionTypes(
+            VectorExpressionDescriptor.InputExpressionType.COLUMN,
+            VectorExpressionDescriptor.InputExpressionType.SCALAR).build();
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/gen/vectorization/ExpressionTemplates/FilterDecimal64ScalarCompareDecimal64Column.txt
----------------------------------------------------------------------
diff --git a/ql/src/gen/vectorization/ExpressionTemplates/FilterDecimal64ScalarCompareDecimal64Column.txt b/ql/src/gen/vectorization/ExpressionTemplates/FilterDecimal64ScalarCompareDecimal64Column.txt
new file mode 100644
index 0000000..6506f37
--- /dev/null
+++ b/ql/src/gen/vectorization/ExpressionTemplates/FilterDecimal64ScalarCompareDecimal64Column.txt
@@ -0,0 +1,54 @@
+/**
+ * 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.gen;
+
+import org.apache.hadoop.hive.ql.exec.vector.VectorExpressionDescriptor;
+
+/**
+ * Generated from template FilterDecimal64ScalarCompareDecimal64Column.txt, which covers decimal64
+ * comparison expressions between a scalar and a column, however output is not produced in a
+ * separate column. The selected vector of the input {@link VectorizedRowBatch} is updated for
+ * in-place filtering.
+ */
+public class <ClassName> extends <BaseClassName> {
+
+  private static final long serialVersionUID = 1L;
+
+  public <ClassName>(long value, int colNum) {
+    super(value, colNum);
+  }
+
+  public <ClassName>() {
+    super();
+  }
+
+  @Override
+  public VectorExpressionDescriptor.Descriptor getDescriptor() {
+    return (new VectorExpressionDescriptor.Builder())
+        .setMode(
+            VectorExpressionDescriptor.Mode.FILTER)
+        .setNumArguments(2)
+        .setArgumentTypes(
+            VectorExpressionDescriptor.ArgumentType.DECIMAL_64,
+            VectorExpressionDescriptor.ArgumentType.DECIMAL_64)
+        .setInputExpressionTypes(
+            VectorExpressionDescriptor.InputExpressionType.SCALAR,
+            VectorExpressionDescriptor.InputExpressionType.COLUMN).build();
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/gen/vectorization/ExpressionTemplates/FilterDecimalColumnBetween.txt
----------------------------------------------------------------------
diff --git a/ql/src/gen/vectorization/ExpressionTemplates/FilterDecimalColumnBetween.txt b/ql/src/gen/vectorization/ExpressionTemplates/FilterDecimalColumnBetween.txt
index 312be49..e4c99fa 100644
--- a/ql/src/gen/vectorization/ExpressionTemplates/FilterDecimalColumnBetween.txt
+++ b/ql/src/gen/vectorization/ExpressionTemplates/FilterDecimalColumnBetween.txt
@@ -36,19 +36,25 @@ public class <ClassName> extends VectorExpression {
 
   private static final long serialVersionUID = 1L;
 
-  private int colNum;
+  private final int colNum;
 
   // The comparison is of the form "column BETWEEN leftValue AND rightValue"
+  // NOTE: These can be set later by FilterColumnBetweenDynamicValue.txt so they are not final.
   private HiveDecimal leftValue;
   private HiveDecimal rightValue;
 
   public <ClassName>(int colNum, HiveDecimal leftValue, HiveDecimal rightValue) {
+    super();
     this.colNum = colNum;
     this.leftValue = leftValue;
     this.rightValue = rightValue;
   }
 
   public <ClassName>() {
+    super();
+
+    // Dummy final assignments.
+    colNum = -1;
   }
 
   @Override
@@ -144,16 +150,6 @@ public class <ClassName> extends VectorExpression {
     }
   }
 
-  @Override
-  public int getOutputColumn() {
-    return -1;
-  }
-
-  @Override
-  public String getOutputType() {
-    return "boolean";
-  }
-
   public HiveDecimal getLeftValue() {
     return leftValue;
   }
@@ -172,7 +168,7 @@ public class <ClassName> extends VectorExpression {
 
   @Override
   public String vectorExpressionParameters() {
-    return "col " + colNum + ", left " + leftValue.toString() + ", right " + rightValue.toString();
+    return getColumnParamString(0, colNum) + ", left " + leftValue.toString() + ", right " + rightValue.toString();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/gen/vectorization/ExpressionTemplates/FilterDecimalColumnCompareDecimalColumn.txt
----------------------------------------------------------------------
diff --git a/ql/src/gen/vectorization/ExpressionTemplates/FilterDecimalColumnCompareDecimalColumn.txt b/ql/src/gen/vectorization/ExpressionTemplates/FilterDecimalColumnCompareDecimalColumn.txt
index ee450d3..20c10ed 100644
--- a/ql/src/gen/vectorization/ExpressionTemplates/FilterDecimalColumnCompareDecimalColumn.txt
+++ b/ql/src/gen/vectorization/ExpressionTemplates/FilterDecimalColumnCompareDecimalColumn.txt
@@ -33,15 +33,21 @@ public class <ClassName> extends VectorExpression {
 
   private static final long serialVersionUID = 1L;
 
-  private int colNum1;
-  private int colNum2;
+  private final int colNum1;
+  private final int colNum2;
 
   public <ClassName>(int colNum1, int colNum2) {
+    super();
     this.colNum1 = colNum1;
     this.colNum2 = colNum2;
   }
 
   public <ClassName>() {
+    super();
+
+    // Dummy final assignments.
+    colNum1 = -1;
+    colNum2 = -1;
   }
 
   @Override
@@ -420,18 +426,8 @@ public class <ClassName> extends VectorExpression {
   }
 
   @Override
-  public String getOutputType() {
-    return "boolean";
-  }
-
-  @Override
-  public int getOutputColumn() {
-    return -1;
-  }
-
-  @Override
   public String vectorExpressionParameters() {
-    return "col " + colNum1 + ", col " + + colNum2;
+    return getColumnParamString(0, colNum1) + ", " + getColumnParamString(1, colNum2);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/gen/vectorization/ExpressionTemplates/FilterDecimalColumnCompareDecimalScalar.txt
----------------------------------------------------------------------
diff --git a/ql/src/gen/vectorization/ExpressionTemplates/FilterDecimalColumnCompareDecimalScalar.txt b/ql/src/gen/vectorization/ExpressionTemplates/FilterDecimalColumnCompareDecimalScalar.txt
index 9943f45..46e79d3 100644
--- a/ql/src/gen/vectorization/ExpressionTemplates/FilterDecimalColumnCompareDecimalScalar.txt
+++ b/ql/src/gen/vectorization/ExpressionTemplates/FilterDecimalColumnCompareDecimalScalar.txt
@@ -38,11 +38,17 @@ public class <ClassName> extends VectorExpression {
   private HiveDecimal value;
 
   public <ClassName>(int colNum, HiveDecimal value) {
+    super();
     this.colNum = colNum;
     this.value = value;
   }
 
   public <ClassName>() {
+    super();
+
+    // Dummy final assignments.
+    colNum = -1;
+    value = null;
   }
 
   @Override
@@ -135,18 +141,8 @@ public class <ClassName> extends VectorExpression {
   }
 
   @Override
-  public int getOutputColumn() {
-    return -1;
-  }
-
-  @Override
-  public String getOutputType() {
-    return "boolean";
-  }
-
-  @Override
   public String vectorExpressionParameters() {
-    return "col " + colNum + ", val " + value.toString();
+    return getColumnParamString(0, colNum) + ", val " + value.toString();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/gen/vectorization/ExpressionTemplates/FilterDecimalScalarCompareDecimalColumn.txt
----------------------------------------------------------------------
diff --git a/ql/src/gen/vectorization/ExpressionTemplates/FilterDecimalScalarCompareDecimalColumn.txt b/ql/src/gen/vectorization/ExpressionTemplates/FilterDecimalScalarCompareDecimalColumn.txt
index 4477aff..5aca39b 100644
--- a/ql/src/gen/vectorization/ExpressionTemplates/FilterDecimalScalarCompareDecimalColumn.txt
+++ b/ql/src/gen/vectorization/ExpressionTemplates/FilterDecimalScalarCompareDecimalColumn.txt
@@ -34,15 +34,21 @@ public class <ClassName> extends VectorExpression {
 
   private static final long serialVersionUID = 1L;
 
-  private int colNum;
-  private HiveDecimal value;
+  private final HiveDecimal value;
+  private final int colNum;
 
   public <ClassName>(HiveDecimal value, int colNum) {
-    this.colNum = colNum;
+    super();
     this.value = value;
+    this.colNum = colNum;
   }
 
   public <ClassName>() {
+    super();
+
+    // Dummy final assignments.
+    value = null;
+    colNum = -1;
   }
 
   @Override
@@ -135,18 +141,8 @@ public class <ClassName> extends VectorExpression {
   }
 
   @Override
-  public int getOutputColumn() {
-    return -1;
-  }
-
-  @Override
-  public String getOutputType() {
-    return "boolean";
-  }
-
-  @Override
   public String vectorExpressionParameters() {
-    return "val " + value.toString() + ", col " + + colNum;
+    return "val " + value.toString() + ", " + getColumnParamString(1, colNum);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/gen/vectorization/ExpressionTemplates/FilterLongDoubleColumnCompareTimestampColumn.txt
----------------------------------------------------------------------
diff --git a/ql/src/gen/vectorization/ExpressionTemplates/FilterLongDoubleColumnCompareTimestampColumn.txt b/ql/src/gen/vectorization/ExpressionTemplates/FilterLongDoubleColumnCompareTimestampColumn.txt
index 610c062..c0c33cd 100644
--- a/ql/src/gen/vectorization/ExpressionTemplates/FilterLongDoubleColumnCompareTimestampColumn.txt
+++ b/ql/src/gen/vectorization/ExpressionTemplates/FilterLongDoubleColumnCompareTimestampColumn.txt
@@ -36,15 +36,21 @@ public class <ClassName> extends VectorExpression {
 
   private static final long serialVersionUID = 1L;
 
-  private int colNum1;
-  private int colNum2;
+  private final int colNum1;
+  private final int colNum2;
 
   public <ClassName>(int colNum1, int colNum2) {
+    super();
     this.colNum1 = colNum1;
     this.colNum2 = colNum2;
   }
 
   public <ClassName>() {
+    super();
+
+    // Dummy final assignments.
+    colNum1 = -1;
+    colNum2 = -1;
   }
 
   @Override
@@ -160,18 +166,8 @@ public class <ClassName> extends VectorExpression {
   }
 
   @Override
-  public String getOutputType() {
-    return "boolean";
-  }
-
-  @Override
-  public int getOutputColumn() {
-    return -1;
-  }
-
-  @Override
   public String vectorExpressionParameters() {
-    return "col " + colNum1 + ", col " + + colNum2;
+    return getColumnParamString(0, colNum1) + ", " + getColumnParamString(1, colNum2);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/gen/vectorization/ExpressionTemplates/FilterLongDoubleScalarCompareTimestampColumn.txt
----------------------------------------------------------------------
diff --git a/ql/src/gen/vectorization/ExpressionTemplates/FilterLongDoubleScalarCompareTimestampColumn.txt b/ql/src/gen/vectorization/ExpressionTemplates/FilterLongDoubleScalarCompareTimestampColumn.txt
index 73c46a1..256eaae 100644
--- a/ql/src/gen/vectorization/ExpressionTemplates/FilterLongDoubleScalarCompareTimestampColumn.txt
+++ b/ql/src/gen/vectorization/ExpressionTemplates/FilterLongDoubleScalarCompareTimestampColumn.txt
@@ -37,15 +37,21 @@ public class <ClassName> extends VectorExpression {
 
   private static final long serialVersionUID = 1L;
 
-  private int colNum;
-  private <OperandType> value;
+  private final int colNum;
+  private final <OperandType> value;
 
   public <ClassName>(<OperandType> value, int colNum) {
-    this.colNum = colNum;
+    super();
     this.value = value;
+    this.colNum = colNum;
   }
 
   public <ClassName>() {
+    super();
+
+    // Dummy final assignments.
+    value = 0;
+    colNum = -1;
   }
 
   @Override
@@ -136,26 +142,8 @@ public class <ClassName> extends VectorExpression {
   }
 
   @Override
-  public int getOutputColumn() {
-    return -1;
-  }
-
-  @Override
-  public String getOutputType() {
-    return "boolean";
-  }
-
-  public int getColNum() {
-    return colNum;
-  }
-
-  public void setColNum(int colNum) {
-    this.colNum = colNum;
-  }
-
-  @Override
   public String vectorExpressionParameters() {
-    return "val " + value + ", col " + + colNum;
+    return "val " + value + ", " + getColumnParamString(1, colNum);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/gen/vectorization/ExpressionTemplates/FilterScalarCompareColumn.txt
----------------------------------------------------------------------
diff --git a/ql/src/gen/vectorization/ExpressionTemplates/FilterScalarCompareColumn.txt b/ql/src/gen/vectorization/ExpressionTemplates/FilterScalarCompareColumn.txt
index 037382c..7fbe4bc 100644
--- a/ql/src/gen/vectorization/ExpressionTemplates/FilterScalarCompareColumn.txt
+++ b/ql/src/gen/vectorization/ExpressionTemplates/FilterScalarCompareColumn.txt
@@ -32,24 +32,30 @@ public class <ClassName> extends VectorExpression {
 
   private static final long serialVersionUID = 1L;
 
-  protected int colNum;
-  protected <OperandType1> value;
+  protected final int colNum;
+  protected final <OperandType1> value;
 
-  public <ClassName>(<OperandType1> value, int colNum) { 
+  public <ClassName>(<OperandType1> value, int colNum) {
+    super();
     this.colNum = colNum;
     this.value = value;
   }
 
   public <ClassName>() {
+    super();
+
+    // Dummy final assignments.
+    colNum = -1;
+    value = 0;
   }
 
   @Override
   public void evaluate(VectorizedRowBatch batch) {
-  
+
     if (childExpressions != null) {
       super.evaluateChildren(batch);
     }
-  
+
     <InputColumnVectorType> inputColVector = (<InputColumnVectorType>) batch.cols[colNum];
     int[] sel = batch.selected;
     boolean[] nullPos = inputColVector.isNull;
@@ -132,34 +138,8 @@ public class <ClassName> extends VectorExpression {
   }
 
   @Override
-  public int getOutputColumn() {
-    return -1;
-  }
-
-  @Override
-  public String getOutputType() {
-    return "boolean";
-  }
-  
-  public int getColNum() {
-    return colNum;
-  }
-
-  public void setColNum(int colNum) {
-    this.colNum = colNum;
-  }
-
-  public <OperandType1> getValue() {
-    return value;
-  }
-
-  public void setValue(<OperandType1> value) {
-    this.value = value;
-  }
-
-  @Override
   public String vectorExpressionParameters() {
-    return "val " + value + ", col " + + colNum;
+    return "val " + value + ", " + getColumnParamString(1, colNum);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/gen/vectorization/ExpressionTemplates/FilterStringColumnBetween.txt
----------------------------------------------------------------------
diff --git a/ql/src/gen/vectorization/ExpressionTemplates/FilterStringColumnBetween.txt b/ql/src/gen/vectorization/ExpressionTemplates/FilterStringColumnBetween.txt
index 47044d6..e63fedd 100644
--- a/ql/src/gen/vectorization/ExpressionTemplates/FilterStringColumnBetween.txt
+++ b/ql/src/gen/vectorization/ExpressionTemplates/FilterStringColumnBetween.txt
@@ -34,17 +34,24 @@ public class <ClassName> extends VectorExpression {
 
   private static final long serialVersionUID = 1L;
 
-  private int colNum;
+  private final int colNum;
+
+  // NOTE: These can be set later by FilterColumnBetweenDynamicValue.txt so they are not final.
   private byte[] left;
   private byte[] right;
 
   public <ClassName>(int colNum, byte[] left, byte[] right) {
+    super();
     this.colNum = colNum;
     this.left = left;
     this.right = right;
   }
 
   public <ClassName>() {
+    super();
+
+    // Dummy final assignments.
+    colNum = -1;
   }
 
   @Override
@@ -145,24 +152,6 @@ public class <ClassName> extends VectorExpression {
     }
   }
 
-  @Override
-  public int getOutputColumn() {
-    return -1;
-  }
-
-  @Override
-  public String getOutputType() {
-    return "boolean";
-  }
-  
-  public int getColNum() {
-    return colNum;
-  }
-
-  public void setColNum(int colNum) {
-    this.colNum = colNum;
-  }
-
   public byte[] getLeftValue() {
     return left;
   }
@@ -181,7 +170,7 @@ public class <ClassName> extends VectorExpression {
 
   @Override
   public String vectorExpressionParameters() {
-    return "col " + colNum + ", left " + displayUtf8Bytes(left) + ", right " + displayUtf8Bytes(right);
+    return getColumnParamString(0, colNum) + ", left " + displayUtf8Bytes(left) + ", right " + displayUtf8Bytes(right);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/gen/vectorization/ExpressionTemplates/FilterStringGroupColumnCompareStringGroupColumn.txt
----------------------------------------------------------------------
diff --git a/ql/src/gen/vectorization/ExpressionTemplates/FilterStringGroupColumnCompareStringGroupColumn.txt b/ql/src/gen/vectorization/ExpressionTemplates/FilterStringGroupColumnCompareStringGroupColumn.txt
index 9114932..4aba240 100644
--- a/ql/src/gen/vectorization/ExpressionTemplates/FilterStringGroupColumnCompareStringGroupColumn.txt
+++ b/ql/src/gen/vectorization/ExpressionTemplates/FilterStringGroupColumnCompareStringGroupColumn.txt
@@ -32,15 +32,21 @@ public class <ClassName> extends VectorExpression {
 
   private static final long serialVersionUID = 1L;
 
-  private int colNum1;
-  private int colNum2;
+  private final int colNum1;
+  private final int colNum2;
 
-  public <ClassName>(int colNum1, int colNum2) { 
+  public <ClassName>(int colNum1, int colNum2) {
+    super();
     this.colNum1 = colNum1;
     this.colNum2 = colNum2;
   }
 
   public <ClassName>() {
+    super();
+
+    // Dummy final assignments.
+    colNum1 = -1;
+    colNum2 = -1;
   }
 
   @Override
@@ -445,40 +451,14 @@ public class <ClassName> extends VectorExpression {
             batch.size = newSize;
             batch.selectedInUse = true;
           }
-        }      
-      } 
+        }
+      }
     }
   }
 
   @Override
-  public String getOutputType() {
-    return "boolean";
-  }
-
-  @Override
-  public int getOutputColumn() {
-    return -1;
-  }
-  
-  public int getColNum1() {
-    return colNum1;
-  }
-
-  public void setColNum1(int colNum1) {
-    this.colNum1 = colNum1;
-  }
-
-  public int getColNum2() {
-    return colNum2;
-  }
-
-  public void setColNum2(int colNum2) {
-    this.colNum2 = colNum2;
-  }
-
-  @Override
   public String vectorExpressionParameters() {
-    return "col " + colNum1 + ", col " + + colNum2;
+    return getColumnParamString(0, colNum1) + ", " + getColumnParamString(1, colNum2);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/gen/vectorization/ExpressionTemplates/FilterStringGroupColumnCompareStringGroupScalarBase.txt
----------------------------------------------------------------------
diff --git a/ql/src/gen/vectorization/ExpressionTemplates/FilterStringGroupColumnCompareStringGroupScalarBase.txt b/ql/src/gen/vectorization/ExpressionTemplates/FilterStringGroupColumnCompareStringGroupScalarBase.txt
index 916bc12..ff2f0f5 100644
--- a/ql/src/gen/vectorization/ExpressionTemplates/FilterStringGroupColumnCompareStringGroupScalarBase.txt
+++ b/ql/src/gen/vectorization/ExpressionTemplates/FilterStringGroupColumnCompareStringGroupScalarBase.txt
@@ -33,8 +33,22 @@ public abstract class <ClassName> extends VectorExpression {
 
   private static final long serialVersionUID = 1L;
 
-  protected int colNum;
-  protected byte[] value;
+  protected final int colNum;
+  protected final byte[] value;
+
+  public <ClassName>(int colNum, byte[] value) {
+    super();
+    this.colNum = colNum;
+    this.value = value;
+  }
+
+  public <ClassName>() {
+    super();
+
+    // Dummy final assignments.
+    colNum = -1;
+    value = null;
+  }
 
   @Override
   public void evaluate(VectorizedRowBatch batch) {
@@ -129,34 +143,8 @@ public abstract class <ClassName> extends VectorExpression {
   }
 
   @Override
-  public int getOutputColumn() {
-    return -1;
-  }
-
-  @Override
-  public String getOutputType() {
-    return "boolean";
-  }
-  
-  public int getColNum() {
-    return colNum;
-  }
-
-  public void setColNum(int colNum) {
-    this.colNum = colNum;
-  }
-
-  public byte[] getValue() {
-    return value;
-  }
-
-  public void setValue(byte[] value) {
-    this.value = value;
-  }
-
-  @Override
   public String vectorExpressionParameters() {
-    return "col " + colNum + ", val " + displayUtf8Bytes(value);
+    return getColumnParamString(0, colNum) + ", val " + displayUtf8Bytes(value);
   }
 
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/gen/vectorization/ExpressionTemplates/FilterStringGroupColumnCompareStringScalar.txt
----------------------------------------------------------------------
diff --git a/ql/src/gen/vectorization/ExpressionTemplates/FilterStringGroupColumnCompareStringScalar.txt b/ql/src/gen/vectorization/ExpressionTemplates/FilterStringGroupColumnCompareStringScalar.txt
index 7ab9f66..1270cc4 100644
--- a/ql/src/gen/vectorization/ExpressionTemplates/FilterStringGroupColumnCompareStringScalar.txt
+++ b/ql/src/gen/vectorization/ExpressionTemplates/FilterStringGroupColumnCompareStringScalar.txt
@@ -32,11 +32,11 @@ import org.apache.hadoop.hive.ql.exec.vector.VectorExpressionDescriptor;
 public class <ClassName> extends <BaseClassName> {
 
   public <ClassName>(int colNum, byte[] value) {
-    this.colNum = colNum;
-    this.value = value;
+    super(colNum, value);
   }
 
   public <ClassName>() {
+    super();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/gen/vectorization/ExpressionTemplates/FilterStringGroupColumnCompareTruncStringScalar.txt
----------------------------------------------------------------------
diff --git a/ql/src/gen/vectorization/ExpressionTemplates/FilterStringGroupColumnCompareTruncStringScalar.txt b/ql/src/gen/vectorization/ExpressionTemplates/FilterStringGroupColumnCompareTruncStringScalar.txt
index aa229c8..8316807 100644
--- a/ql/src/gen/vectorization/ExpressionTemplates/FilterStringGroupColumnCompareTruncStringScalar.txt
+++ b/ql/src/gen/vectorization/ExpressionTemplates/FilterStringGroupColumnCompareTruncStringScalar.txt
@@ -34,11 +34,11 @@ import org.apache.hadoop.hive.ql.exec.vector.VectorExpressionDescriptor;
 public class <ClassName> extends <BaseClassName> {
 
   public <ClassName>(int colNum, <TruncStringHiveType> value) {
-    this.colNum = colNum;
-    this.value = value.<TruncStringHiveGetBytes>;
+    super(colNum, value.<TruncStringHiveGetBytes>);
   }
 
   public <ClassName>() {
+    super();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/gen/vectorization/ExpressionTemplates/FilterStringGroupScalarCompareStringGroupColumnBase.txt
----------------------------------------------------------------------
diff --git a/ql/src/gen/vectorization/ExpressionTemplates/FilterStringGroupScalarCompareStringGroupColumnBase.txt b/ql/src/gen/vectorization/ExpressionTemplates/FilterStringGroupScalarCompareStringGroupColumnBase.txt
index bfc58a1..24e2497 100644
--- a/ql/src/gen/vectorization/ExpressionTemplates/FilterStringGroupScalarCompareStringGroupColumnBase.txt
+++ b/ql/src/gen/vectorization/ExpressionTemplates/FilterStringGroupScalarCompareStringGroupColumnBase.txt
@@ -28,16 +28,27 @@ import org.apache.hadoop.hive.ql.exec.vector.VectorExpressionDescriptor;
 
 /**
  * This is a generated class to evaluate a <OperatorSymbol> comparison on a vector of strings.
- * Do not edit the generated code directly. 
+ * Do not edit the generated code directly.
  */
 public abstract class <ClassName> extends VectorExpression {
 
   private static final long serialVersionUID = 1L;
 
-  protected int colNum;
-  protected byte[] value;
+  protected final byte[] value;
+  protected final int colNum;
+
+  public <ClassName>(byte[] value, int colNum) {
+    super();
+    this.value = value;
+    this.colNum = colNum;
+  }
 
   public <ClassName>() {
+    super();
+
+    // Dummy final assignments.
+    value = null;
+    colNum = -1;
   }
 
   @Override
@@ -133,34 +144,8 @@ public abstract class <ClassName> extends VectorExpression {
   }
 
   @Override
-  public int getOutputColumn() {
-    return -1;
-  }
-
-  @Override
-  public String getOutputType() {
-    return "boolean";
-  }
-  
-  public int getColNum() {
-    return colNum;
-  }
-
-  public void setColNum(int colNum) {
-    this.colNum = colNum;
-  }
-
-  public byte[] getValue() {
-    return value;
-  }
-
-  public void setValue(byte[] value) {
-    this.value = value;
-  }
-
-  @Override
   public String vectorExpressionParameters() {
-    return "val " + displayUtf8Bytes(value) + ", col " + + colNum;
+    return "val " + displayUtf8Bytes(value) + ", " + getColumnParamString(1, colNum);
   }
 
 }

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/gen/vectorization/ExpressionTemplates/FilterStringScalarCompareStringGroupColumn.txt
----------------------------------------------------------------------
diff --git a/ql/src/gen/vectorization/ExpressionTemplates/FilterStringScalarCompareStringGroupColumn.txt b/ql/src/gen/vectorization/ExpressionTemplates/FilterStringScalarCompareStringGroupColumn.txt
index bb638a4..81f654a 100644
--- a/ql/src/gen/vectorization/ExpressionTemplates/FilterStringScalarCompareStringGroupColumn.txt
+++ b/ql/src/gen/vectorization/ExpressionTemplates/FilterStringScalarCompareStringGroupColumn.txt
@@ -28,16 +28,16 @@ import org.apache.hadoop.hive.ql.exec.vector.VectorExpressionDescriptor;
 
 /**
  * This is a generated class to evaluate a <OperatorSymbol> comparison on a vector of strings.
- * Do not edit the generated code directly. 
+ * Do not edit the generated code directly.
  */
 public class <ClassName> extends <BaseClassName> {
 
   public <ClassName>(byte[] value, int colNum) {
-    this.colNum = colNum;
-    this.value = value;
+    super(value, colNum);
   }
 
   public <ClassName>() {
+    super();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/gen/vectorization/ExpressionTemplates/FilterTimestampColumnBetween.txt
----------------------------------------------------------------------
diff --git a/ql/src/gen/vectorization/ExpressionTemplates/FilterTimestampColumnBetween.txt b/ql/src/gen/vectorization/ExpressionTemplates/FilterTimestampColumnBetween.txt
index 9c268e2..08c6766 100644
--- a/ql/src/gen/vectorization/ExpressionTemplates/FilterTimestampColumnBetween.txt
+++ b/ql/src/gen/vectorization/ExpressionTemplates/FilterTimestampColumnBetween.txt
@@ -35,20 +35,25 @@ public class <ClassName> extends VectorExpression {
 
   private static final long serialVersionUID = 1L;
 
-  private int colNum;
+  private final int colNum;
 
   // The comparison is of the form "column BETWEEN leftValue AND rightValue"
+  // NOTE: These can be set later by FilterColumnBetweenDynamicValue.txt so they are not final.
   private Timestamp leftValue;
   private Timestamp rightValue;
-  private Timestamp scratchValue;
 
   public <ClassName>(int colNum, Timestamp leftValue, Timestamp rightValue) {
+    super();
     this.colNum = colNum;
     this.leftValue = leftValue;
     this.rightValue = rightValue;
   }
 
   public <ClassName>() {
+    super();
+
+    // Dummy final assignments.
+    colNum = -1;
   }
 
   @Override
@@ -143,16 +148,6 @@ public class <ClassName> extends VectorExpression {
     }
   }
 
-  @Override
-  public int getOutputColumn() {
-    return -1;
-  }
-
-  @Override
-  public String getOutputType() {
-    return "boolean";
-  }
-
   public Timestamp getLeftValue() {
     return leftValue;
   }
@@ -171,7 +166,7 @@ public class <ClassName> extends VectorExpression {
 
   @Override
   public String vectorExpressionParameters() {
-    return "col " + colNum + ", left " + leftValue.toString() + ", right " + rightValue.toString();
+    return getColumnParamString(0, colNum) + ", left " + leftValue.toString() + ", right " + rightValue.toString();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/gen/vectorization/ExpressionTemplates/FilterTimestampColumnCompareLongDoubleColumn.txt
----------------------------------------------------------------------
diff --git a/ql/src/gen/vectorization/ExpressionTemplates/FilterTimestampColumnCompareLongDoubleColumn.txt b/ql/src/gen/vectorization/ExpressionTemplates/FilterTimestampColumnCompareLongDoubleColumn.txt
index 8873826..03a95ba 100644
--- a/ql/src/gen/vectorization/ExpressionTemplates/FilterTimestampColumnCompareLongDoubleColumn.txt
+++ b/ql/src/gen/vectorization/ExpressionTemplates/FilterTimestampColumnCompareLongDoubleColumn.txt
@@ -33,15 +33,21 @@ public class <ClassName> extends VectorExpression {
 
   private static final long serialVersionUID = 1L;
 
-  private int colNum1;
-  private int colNum2;
+  private final int colNum1;
+  private final int colNum2;
 
   public <ClassName>(int colNum1, int colNum2) {
+    super();
     this.colNum1 = colNum1;
     this.colNum2 = colNum2;
   }
 
   public <ClassName>() {
+    super();
+
+    // Dummy final assignments.
+    colNum1 = -1;
+    colNum2 = -1;
   }
 
   @Override
@@ -157,18 +163,8 @@ public class <ClassName> extends VectorExpression {
   }
 
   @Override
-  public String getOutputType() {
-    return "boolean";
-  }
-
-  @Override
-  public int getOutputColumn() {
-    return -1;
-  }
-
-  @Override
   public String vectorExpressionParameters() {
-    return "col " + colNum1 + ", col " + + colNum2;
+    return getColumnParamString(0, colNum1) + ", " + getColumnParamString(1, colNum2);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/e63ebccc/ql/src/gen/vectorization/ExpressionTemplates/FilterTimestampColumnCompareLongDoubleScalar.txt
----------------------------------------------------------------------
diff --git a/ql/src/gen/vectorization/ExpressionTemplates/FilterTimestampColumnCompareLongDoubleScalar.txt b/ql/src/gen/vectorization/ExpressionTemplates/FilterTimestampColumnCompareLongDoubleScalar.txt
index 8583eee..1f1bdd2 100644
--- a/ql/src/gen/vectorization/ExpressionTemplates/FilterTimestampColumnCompareLongDoubleScalar.txt
+++ b/ql/src/gen/vectorization/ExpressionTemplates/FilterTimestampColumnCompareLongDoubleScalar.txt
@@ -33,15 +33,21 @@ public class <ClassName> extends VectorExpression {
 
   private static final long serialVersionUID = 1L;
 
-  private int colNum;
-  private <OperandType> value;
+  private final int colNum;
+  private final <OperandType> value;
 
   public <ClassName>(int colNum, <OperandType> value) {
+    super();
     this.colNum = colNum;
     this.value = value;
   }
 
   public <ClassName>() {
+    super();
+
+    // Dummy final assignments.
+    colNum = -1;
+    value = 0;
   }
 
   @Override
@@ -132,26 +138,8 @@ public class <ClassName> extends VectorExpression {
   }
 
   @Override
-  public int getOutputColumn() {
-    return -1;
-  }
-
-  @Override
-  public String getOutputType() {
-    return "boolean";
-  }
-
-  public int getColNum() {
-    return colNum;
-  }
-
-  public void setColNum(int colNum) {
-    this.colNum = colNum;
-  }
-
-  @Override
   public String vectorExpressionParameters() {
-    return "col " + colNum + ", val " + value;
+    return getColumnParamString(0, colNum) + ", val " + value;
   }
 
   @Override


Mime
View raw message