hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hashut...@apache.org
Subject svn commit: r1535055 [5/14] - in /hive/trunk: ant/src/org/apache/hadoop/hive/ant/ ql/src/gen/vectorization/ExpressionTemplates/ ql/src/gen/vectorization/TestTemplates/ ql/src/java/org/apache/hadoop/hive/ql/exec/ ql/src/java/org/apache/hadoop/hive/ql/ex...
Date Wed, 23 Oct 2013 15:15:14 GMT
Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPEqualOrGreaterThan.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPEqualOrGreaterThan.java?rev=1535055&r1=1535054&r2=1535055&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPEqualOrGreaterThan.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPEqualOrGreaterThan.java Wed Oct 23 15:15:11 2013
@@ -19,6 +19,37 @@
 package org.apache.hadoop.hive.ql.udf.generic;
 
 import org.apache.hadoop.hive.ql.exec.Description;
+import org.apache.hadoop.hive.ql.exec.vector.VectorizedExpressions;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.DoubleColGreaterEqualDoubleColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.DoubleColGreaterEqualDoubleScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.DoubleColGreaterEqualLongColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.DoubleColGreaterEqualLongScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.DoubleScalarGreaterEqualDoubleColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.DoubleScalarGreaterEqualLongColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterDoubleColGreaterEqualDoubleColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterDoubleColGreaterEqualDoubleScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterDoubleColGreaterEqualLongColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterDoubleColGreaterEqualLongScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterDoubleScalarGreaterEqualDoubleColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterDoubleScalarGreaterEqualLongColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterLongColGreaterEqualDoubleColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterLongColGreaterEqualDoubleScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterLongColGreaterEqualLongColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterLongColGreaterEqualLongScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterLongScalarGreaterEqualDoubleColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterLongScalarGreaterEqualLongColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterStringColGreaterEqualStringColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterStringColGreaterEqualStringScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterStringScalarGreaterEqualStringColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.LongColGreaterEqualDoubleColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.LongColGreaterEqualDoubleScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.LongColGreaterEqualLongColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.LongColGreaterEqualLongScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.LongScalarGreaterEqualDoubleColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.LongScalarGreaterEqualLongColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.StringColGreaterEqualStringColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.StringColGreaterEqualStringScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.StringScalarGreaterEqualStringColumn;
 import org.apache.hadoop.hive.ql.metadata.HiveException;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorUtils;
 import org.apache.hadoop.hive.shims.ShimLoader;
@@ -28,6 +59,21 @@ import org.apache.hadoop.io.Text;
  * GenericUDF Class for operation EqualOrGreaterThan.
  */
 @Description(name = ">=", value = "a _FUNC_ b - Returns TRUE if a is not smaller than b")
+@VectorizedExpressions({LongColGreaterEqualLongColumn.class, LongColGreaterEqualDoubleColumn.class,
+  DoubleColGreaterEqualLongColumn.class, DoubleColGreaterEqualDoubleColumn.class,
+  LongColGreaterEqualLongScalar.class, LongColGreaterEqualDoubleScalar.class,
+  DoubleColGreaterEqualLongScalar.class, DoubleColGreaterEqualDoubleScalar.class,
+  LongScalarGreaterEqualLongColumn.class, LongScalarGreaterEqualDoubleColumn.class,
+  DoubleScalarGreaterEqualLongColumn.class, DoubleScalarGreaterEqualDoubleColumn.class,
+  StringColGreaterEqualStringColumn.class, StringColGreaterEqualStringScalar.class,
+  StringScalarGreaterEqualStringColumn.class, FilterStringColGreaterEqualStringColumn.class,
+  FilterStringColGreaterEqualStringScalar.class, FilterStringScalarGreaterEqualStringColumn.class,
+  FilterLongColGreaterEqualLongColumn.class, FilterLongColGreaterEqualDoubleColumn.class,
+  FilterDoubleColGreaterEqualLongColumn.class, FilterDoubleColGreaterEqualDoubleColumn.class,
+  FilterLongColGreaterEqualLongScalar.class, FilterLongColGreaterEqualDoubleScalar.class,
+  FilterDoubleColGreaterEqualLongScalar.class, FilterDoubleColGreaterEqualDoubleScalar.class,
+  FilterLongScalarGreaterEqualLongColumn.class, FilterLongScalarGreaterEqualDoubleColumn.class,
+  FilterDoubleScalarGreaterEqualLongColumn.class, FilterDoubleScalarGreaterEqualDoubleColumn.class})
 public class GenericUDFOPEqualOrGreaterThan extends GenericUDFBaseCompare {
   public GenericUDFOPEqualOrGreaterThan(){
     this.opName = "EQUAL OR GREATER THAN";

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPEqualOrLessThan.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPEqualOrLessThan.java?rev=1535055&r1=1535054&r2=1535055&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPEqualOrLessThan.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPEqualOrLessThan.java Wed Oct 23 15:15:11 2013
@@ -19,6 +19,37 @@
 package org.apache.hadoop.hive.ql.udf.generic;
 
 import org.apache.hadoop.hive.ql.exec.Description;
+import org.apache.hadoop.hive.ql.exec.vector.VectorizedExpressions;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.DoubleColLessEqualDoubleColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.DoubleColLessEqualDoubleScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.DoubleColLessEqualLongColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.DoubleColLessEqualLongScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.DoubleScalarLessEqualDoubleColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.DoubleScalarLessEqualLongColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterDoubleColLessEqualDoubleColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterDoubleColLessEqualDoubleScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterDoubleColLessEqualLongColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterDoubleColLessEqualLongScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterDoubleScalarLessEqualDoubleColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterDoubleScalarLessEqualLongColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterLongColLessEqualDoubleColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterLongColLessEqualDoubleScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterLongColLessEqualLongColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterLongColLessEqualLongScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterLongScalarLessEqualDoubleColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterLongScalarLessEqualLongColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterStringColLessEqualStringColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterStringColLessEqualStringScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterStringScalarLessEqualStringColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.LongColLessEqualDoubleColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.LongColLessEqualDoubleScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.LongColLessEqualLongColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.LongColLessEqualLongScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.LongScalarLessEqualDoubleColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.LongScalarLessEqualLongColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.StringColLessEqualStringColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.StringColLessEqualStringScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.StringScalarLessEqualStringColumn;
 import org.apache.hadoop.hive.ql.metadata.HiveException;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorUtils;
 import org.apache.hadoop.hive.shims.ShimLoader;
@@ -28,6 +59,21 @@ import org.apache.hadoop.io.Text;
  * GenericUDF Class for operation EqualOrLessThan.
  */
 @Description(name = "<=", value = "a _FUNC_ b - Returns TRUE if a is not greater than b")
+@VectorizedExpressions({LongColLessEqualLongColumn.class, LongColLessEqualDoubleColumn.class,
+  DoubleColLessEqualLongColumn.class, DoubleColLessEqualDoubleColumn.class,
+  LongColLessEqualLongScalar.class, LongColLessEqualDoubleScalar.class,
+  DoubleColLessEqualLongScalar.class, DoubleColLessEqualDoubleScalar.class,
+  LongScalarLessEqualLongColumn.class, LongScalarLessEqualDoubleColumn.class,
+  DoubleScalarLessEqualLongColumn.class, DoubleScalarLessEqualDoubleColumn.class,
+  StringColLessEqualStringColumn.class, StringColLessEqualStringScalar.class,
+  StringScalarLessEqualStringColumn.class, FilterStringColLessEqualStringColumn.class,
+  FilterStringColLessEqualStringScalar.class, FilterStringScalarLessEqualStringColumn.class,
+  FilterLongColLessEqualLongColumn.class, FilterLongColLessEqualDoubleColumn.class,
+  FilterDoubleColLessEqualLongColumn.class, FilterDoubleColLessEqualDoubleColumn.class,
+  FilterLongColLessEqualLongScalar.class, FilterLongColLessEqualDoubleScalar.class,
+  FilterDoubleColLessEqualLongScalar.class, FilterDoubleColLessEqualDoubleScalar.class,
+  FilterLongScalarLessEqualLongColumn.class, FilterLongScalarLessEqualDoubleColumn.class,
+  FilterDoubleScalarLessEqualLongColumn.class, FilterDoubleScalarLessEqualDoubleColumn.class})
 public class GenericUDFOPEqualOrLessThan extends GenericUDFBaseCompare {
   public GenericUDFOPEqualOrLessThan(){
     this.opName = "EQUAL OR LESS THAN";

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPGreaterThan.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPGreaterThan.java?rev=1535055&r1=1535054&r2=1535055&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPGreaterThan.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPGreaterThan.java Wed Oct 23 15:15:11 2013
@@ -19,6 +19,37 @@
 package org.apache.hadoop.hive.ql.udf.generic;
 
 import org.apache.hadoop.hive.ql.exec.Description;
+import org.apache.hadoop.hive.ql.exec.vector.VectorizedExpressions;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.DoubleColGreaterDoubleColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.DoubleColGreaterDoubleScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.DoubleColGreaterLongColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.DoubleColGreaterLongScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.DoubleScalarGreaterDoubleColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.DoubleScalarGreaterLongColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterDoubleColGreaterDoubleColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterDoubleColGreaterDoubleScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterDoubleColGreaterLongColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterDoubleColGreaterLongScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterDoubleScalarGreaterDoubleColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterDoubleScalarGreaterLongColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterLongColGreaterDoubleColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterLongColGreaterDoubleScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterLongColGreaterLongColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterLongColGreaterLongScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterLongScalarGreaterDoubleColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterLongScalarGreaterLongColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterStringColGreaterStringColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterStringColGreaterStringScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterStringScalarGreaterStringColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.LongColGreaterDoubleColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.LongColGreaterDoubleScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.LongColGreaterLongColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.LongColGreaterLongScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.LongScalarGreaterDoubleColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.LongScalarGreaterLongColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.StringColGreaterStringColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.StringColGreaterStringScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.StringScalarGreaterStringColumn;
 import org.apache.hadoop.hive.ql.metadata.HiveException;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorUtils;
 import org.apache.hadoop.hive.shims.ShimLoader;
@@ -28,6 +59,21 @@ import org.apache.hadoop.io.Text;
  * GenericUDF Class for operation GreaterThan.
  */
 @Description(name = ">", value = "a _FUNC_ b - Returns TRUE if a is greater than b")
+@VectorizedExpressions({LongColGreaterLongColumn.class, LongColGreaterDoubleColumn.class,
+  DoubleColGreaterLongColumn.class, DoubleColGreaterDoubleColumn.class,
+  LongColGreaterLongScalar.class, LongColGreaterDoubleScalar.class,
+  DoubleColGreaterLongScalar.class, DoubleColGreaterDoubleScalar.class,
+  LongScalarGreaterLongColumn.class, LongScalarGreaterDoubleColumn.class,
+  DoubleScalarGreaterLongColumn.class, DoubleScalarGreaterDoubleColumn.class,
+  StringColGreaterStringColumn.class, StringColGreaterStringScalar.class,
+  StringScalarGreaterStringColumn.class, FilterStringColGreaterStringColumn.class,
+  FilterStringColGreaterStringScalar.class, FilterStringScalarGreaterStringColumn.class,
+  FilterLongColGreaterLongColumn.class, FilterLongColGreaterDoubleColumn.class,
+  FilterDoubleColGreaterLongColumn.class, FilterDoubleColGreaterDoubleColumn.class,
+  FilterLongColGreaterLongScalar.class, FilterLongColGreaterDoubleScalar.class,
+  FilterDoubleColGreaterLongScalar.class, FilterDoubleColGreaterDoubleScalar.class,
+  FilterLongScalarGreaterLongColumn.class, FilterLongScalarGreaterDoubleColumn.class,
+  FilterDoubleScalarGreaterLongColumn.class, FilterDoubleScalarGreaterDoubleColumn.class})
 public class GenericUDFOPGreaterThan extends GenericUDFBaseCompare {
   public GenericUDFOPGreaterThan(){
     this.opName = "GREATER THAN";

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPLessThan.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPLessThan.java?rev=1535055&r1=1535054&r2=1535055&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPLessThan.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPLessThan.java Wed Oct 23 15:15:11 2013
@@ -19,6 +19,8 @@
 package org.apache.hadoop.hive.ql.udf.generic;
 
 import org.apache.hadoop.hive.ql.exec.Description;
+import org.apache.hadoop.hive.ql.exec.vector.VectorizedExpressions;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.*;
 import org.apache.hadoop.hive.ql.metadata.HiveException;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorUtils;
 import org.apache.hadoop.hive.shims.ShimLoader;
@@ -28,6 +30,21 @@ import org.apache.hadoop.io.Text;
  * GenericUDF Class for operation LessThan.
  */
 @Description(name = "<", value = "a _FUNC_ b - Returns TRUE if a is less than b")
+@VectorizedExpressions({LongColLessLongColumn.class, LongColLessDoubleColumn.class,
+    DoubleColLessLongColumn.class, DoubleColLessDoubleColumn.class,
+    LongColLessLongScalar.class, LongColLessDoubleScalar.class,
+    DoubleColLessLongScalar.class, DoubleColLessDoubleScalar.class,
+    LongScalarLessLongColumn.class, LongScalarLessDoubleColumn.class,
+    DoubleScalarLessLongColumn.class, DoubleScalarLessDoubleColumn.class,
+    StringColLessStringColumn.class, StringColLessStringScalar.class,
+    StringScalarLessStringColumn.class, FilterStringColLessStringColumn.class,
+    FilterStringColLessStringScalar.class, FilterStringScalarLessStringColumn.class,
+    FilterLongColLessLongColumn.class, FilterLongColLessDoubleColumn.class,
+    FilterDoubleColLessLongColumn.class, FilterDoubleColLessDoubleColumn.class,
+    FilterLongColLessLongScalar.class, FilterLongColLessDoubleScalar.class,
+    FilterDoubleColLessLongScalar.class, FilterDoubleColLessDoubleScalar.class,
+    FilterLongScalarLessLongColumn.class, FilterLongScalarLessDoubleColumn.class,
+    FilterDoubleScalarLessLongColumn.class, FilterDoubleScalarLessDoubleColumn.class})
 public class GenericUDFOPLessThan extends GenericUDFBaseCompare {
   public GenericUDFOPLessThan(){
     this.opName = "LESS THAN";

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPNot.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPNot.java?rev=1535055&r1=1535054&r2=1535055&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPNot.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPNot.java Wed Oct 23 15:15:11 2013
@@ -21,6 +21,9 @@ package org.apache.hadoop.hive.ql.udf.ge
 import org.apache.hadoop.hive.ql.exec.Description;
 import org.apache.hadoop.hive.ql.exec.UDFArgumentException;
 import org.apache.hadoop.hive.ql.exec.UDFArgumentLengthException;
+import org.apache.hadoop.hive.ql.exec.vector.VectorizedExpressions;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.NotCol;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.SelectColumnIsFalse;
 import org.apache.hadoop.hive.ql.metadata.HiveException;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.BooleanObjectInspector;
@@ -32,6 +35,7 @@ import org.apache.hadoop.io.BooleanWrita
  *
  */
 @Description(name = "not", value = "_FUNC_ a - Logical not")
+@VectorizedExpressions({NotCol.class, SelectColumnIsFalse.class})
 public class GenericUDFOPNot extends GenericUDF {
   private final BooleanWritable result = new BooleanWritable();
   private transient BooleanObjectInspector boi;

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPNotEqual.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPNotEqual.java?rev=1535055&r1=1535054&r2=1535055&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPNotEqual.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPNotEqual.java Wed Oct 23 15:15:11 2013
@@ -19,6 +19,37 @@
 package org.apache.hadoop.hive.ql.udf.generic;
 
 import org.apache.hadoop.hive.ql.exec.Description;
+import org.apache.hadoop.hive.ql.exec.vector.VectorizedExpressions;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.DoubleColNotEqualDoubleColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.DoubleColNotEqualDoubleScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.DoubleColNotEqualLongColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.DoubleColNotEqualLongScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.DoubleScalarNotEqualDoubleColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.DoubleScalarNotEqualLongColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterDoubleColNotEqualDoubleColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterDoubleColNotEqualDoubleScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterDoubleColNotEqualLongColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterDoubleColNotEqualLongScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterDoubleScalarNotEqualDoubleColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterDoubleScalarNotEqualLongColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterLongColNotEqualDoubleColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterLongColNotEqualDoubleScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterLongColNotEqualLongColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterLongColNotEqualLongScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterLongScalarNotEqualDoubleColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterLongScalarNotEqualLongColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterStringColNotEqualStringColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterStringColNotEqualStringScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterStringScalarNotEqualStringColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.LongColNotEqualDoubleColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.LongColNotEqualDoubleScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.LongColNotEqualLongColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.LongColNotEqualLongScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.LongScalarNotEqualDoubleColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.LongScalarNotEqualLongColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.StringColNotEqualStringColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.StringColNotEqualStringScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.StringScalarNotEqualStringColumn;
 import org.apache.hadoop.hive.ql.metadata.HiveException;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorUtils;
 
@@ -26,6 +57,21 @@ import org.apache.hadoop.hive.serde2.obj
  * GenericUDF Class for operation Not EQUAL.
  */
 @Description(name = "<>", value = "a _FUNC_ b - Returns TRUE if a is not equal to b")
+@VectorizedExpressions({LongColNotEqualLongColumn.class, LongColNotEqualDoubleColumn.class,
+  DoubleColNotEqualLongColumn.class, DoubleColNotEqualDoubleColumn.class,
+  LongColNotEqualLongScalar.class, LongColNotEqualDoubleScalar.class,
+  DoubleColNotEqualLongScalar.class, DoubleColNotEqualDoubleScalar.class,
+  LongScalarNotEqualLongColumn.class, LongScalarNotEqualDoubleColumn.class,
+  DoubleScalarNotEqualLongColumn.class, DoubleScalarNotEqualDoubleColumn.class,
+  StringColNotEqualStringColumn.class, StringColNotEqualStringScalar.class,
+  StringScalarNotEqualStringColumn.class, FilterStringColNotEqualStringColumn.class,
+  FilterStringColNotEqualStringScalar.class, FilterStringScalarNotEqualStringColumn.class,
+  FilterLongColNotEqualLongColumn.class, FilterLongColNotEqualDoubleColumn.class,
+  FilterDoubleColNotEqualLongColumn.class, FilterDoubleColNotEqualDoubleColumn.class,
+  FilterLongColNotEqualLongScalar.class, FilterLongColNotEqualDoubleScalar.class,
+  FilterDoubleColNotEqualLongScalar.class, FilterDoubleColNotEqualDoubleScalar.class,
+  FilterLongScalarNotEqualLongColumn.class, FilterLongScalarNotEqualDoubleColumn.class,
+  FilterDoubleScalarNotEqualLongColumn.class, FilterDoubleScalarNotEqualDoubleColumn.class})
 public class GenericUDFOPNotEqual extends GenericUDFBaseCompare {
   public GenericUDFOPNotEqual(){
     this.opName = "NOT EQUAL";

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPNotNull.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPNotNull.java?rev=1535055&r1=1535054&r2=1535055&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPNotNull.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPNotNull.java Wed Oct 23 15:15:11 2013
@@ -21,6 +21,9 @@ package org.apache.hadoop.hive.ql.udf.ge
 import org.apache.hadoop.hive.ql.exec.Description;
 import org.apache.hadoop.hive.ql.exec.UDFArgumentException;
 import org.apache.hadoop.hive.ql.exec.UDFArgumentLengthException;
+import org.apache.hadoop.hive.ql.exec.vector.VectorizedExpressions;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.IsNotNull;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.SelectColumnIsNotNull;
 import org.apache.hadoop.hive.ql.metadata.HiveException;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory;
@@ -32,8 +35,9 @@ import org.apache.hadoop.io.BooleanWrita
  */
 @Description(name = "isnotnull",
     value = "_FUNC_ a - Returns true if a is not NULL and false otherwise")
+@VectorizedExpressions({IsNotNull.class, SelectColumnIsNotNull.class})
 public class GenericUDFOPNotNull extends GenericUDF {
-  private BooleanWritable result = new BooleanWritable();
+  private final BooleanWritable result = new BooleanWritable();
 
   @Override
   public ObjectInspector initialize(ObjectInspector[] arguments) throws UDFArgumentException {

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPNull.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPNull.java?rev=1535055&r1=1535054&r2=1535055&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPNull.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPNull.java Wed Oct 23 15:15:11 2013
@@ -21,6 +21,9 @@ package org.apache.hadoop.hive.ql.udf.ge
 import org.apache.hadoop.hive.ql.exec.Description;
 import org.apache.hadoop.hive.ql.exec.UDFArgumentException;
 import org.apache.hadoop.hive.ql.exec.UDFArgumentLengthException;
+import org.apache.hadoop.hive.ql.exec.vector.VectorizedExpressions;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.IsNull;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.SelectColumnIsNull;
 import org.apache.hadoop.hive.ql.metadata.HiveException;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory;
@@ -31,8 +34,9 @@ import org.apache.hadoop.io.BooleanWrita
  *
  */
 @Description(name = "isnull", value = "_FUNC_ a - Returns true if a is NULL and false otherwise")
+@VectorizedExpressions({IsNull.class, SelectColumnIsNull.class})
 public class GenericUDFOPNull extends GenericUDF {
-  private BooleanWritable result = new BooleanWritable();
+  private final BooleanWritable result = new BooleanWritable();
 
   @Override
   public ObjectInspector initialize(ObjectInspector[] arguments)

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPOr.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPOr.java?rev=1535055&r1=1535054&r2=1535055&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPOr.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPOr.java Wed Oct 23 15:15:11 2013
@@ -21,6 +21,11 @@ package org.apache.hadoop.hive.ql.udf.ge
 import org.apache.hadoop.hive.ql.exec.Description;
 import org.apache.hadoop.hive.ql.exec.UDFArgumentException;
 import org.apache.hadoop.hive.ql.exec.UDFArgumentLengthException;
+import org.apache.hadoop.hive.ql.exec.vector.VectorizedExpressions;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.ColOrCol;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.FilterColOrScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.FilterExprOrExpr;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.FilterScalarOrColumn;
 import org.apache.hadoop.hive.ql.metadata.HiveException;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.BooleanObjectInspector;
@@ -31,6 +36,8 @@ import org.apache.hadoop.io.BooleanWrita
  * GenericUDF Class for computing or.
  */
 @Description(name = "or", value = "a _FUNC_ b - Logical or")
+@VectorizedExpressions({ColOrCol.class, FilterExprOrExpr.class, FilterColOrScalar.class,
+    FilterScalarOrColumn.class})
 public class GenericUDFOPOr extends GenericUDF {
   private final BooleanWritable result = new BooleanWritable();
   private transient BooleanObjectInspector boi0,boi1;

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFTimestamp.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFTimestamp.java?rev=1535055&r1=1535054&r2=1535055&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFTimestamp.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFTimestamp.java Wed Oct 23 15:15:11 2013
@@ -19,6 +19,9 @@ package org.apache.hadoop.hive.ql.udf.ge
 
 import org.apache.hadoop.hive.ql.exec.UDFArgumentException;
 import org.apache.hadoop.hive.ql.exec.UDFArgumentLengthException;
+import org.apache.hadoop.hive.ql.exec.vector.VectorizedExpressions;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.CastDoubleToTimestampViaDoubleToLong;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.CastLongToTimestampViaLongToLong;
 import org.apache.hadoop.hive.ql.metadata.HiveException;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector;
@@ -35,6 +38,8 @@ import org.apache.hadoop.hive.serde2.obj
  * Creates a TimestampWritable object using PrimitiveObjectInspectorConverter
  *
  */
+@VectorizedExpressions({CastLongToTimestampViaLongToLong.class,
+  CastDoubleToTimestampViaDoubleToLong.class})
 public class GenericUDFTimestamp extends GenericUDF {
 
   private transient PrimitiveObjectInspector argumentOI;

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFToUnixTimeStamp.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFToUnixTimeStamp.java?rev=1535055&r1=1535054&r2=1535055&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFToUnixTimeStamp.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFToUnixTimeStamp.java Wed Oct 23 15:15:11 2013
@@ -26,6 +26,8 @@ import org.apache.commons.lang.StringUti
 import org.apache.hadoop.hive.ql.exec.Description;
 import org.apache.hadoop.hive.ql.exec.UDFArgumentException;
 import org.apache.hadoop.hive.ql.exec.UDFArgumentLengthException;
+import org.apache.hadoop.hive.ql.exec.vector.VectorizedExpressions;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorUDFUnixTimeStampLong;
 import org.apache.hadoop.hive.ql.metadata.HiveException;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.DateObjectInspector;
@@ -40,6 +42,7 @@ import org.apache.hadoop.io.LongWritable
 @Description(name = "to_unix_timestamp",
     value = "_FUNC_(date[, pattern]) - Returns the UNIX timestamp",
     extended = "Converts the specified time to number of seconds since 1970-01-01.")
+@VectorizedExpressions({VectorUDFUnixTimeStampLong.class})
 public class GenericUDFToUnixTimeStamp extends GenericUDF {
 
   private transient StringObjectInspector intputTextOI;

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFUpper.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFUpper.java?rev=1535055&r1=1535054&r2=1535055&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFUpper.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFUpper.java Wed Oct 23 15:15:11 2013
@@ -21,6 +21,8 @@ package org.apache.hadoop.hive.ql.udf.ge
 import org.apache.hadoop.hive.ql.exec.Description;
 import org.apache.hadoop.hive.ql.exec.UDFArgumentException;
 import org.apache.hadoop.hive.ql.exec.UDFArgumentLengthException;
+import org.apache.hadoop.hive.ql.exec.vector.VectorizedExpressions;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.StringUpper;
 import org.apache.hadoop.hive.ql.metadata.HiveException;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector.Category;
@@ -40,6 +42,7 @@ import org.apache.hadoop.hive.serde2.typ
     value = "_FUNC_(str) - Returns str with all characters changed to uppercase",
     extended = "Example:\n"
     + "  > SELECT _FUNC_('Facebook') FROM src LIMIT 1;\n" + "  'FACEBOOK'")
+@VectorizedExpressions({StringUpper.class})
 public class GenericUDFUpper extends GenericUDF {
   private transient PrimitiveObjectInspector argumentOI;
   private transient StringConverter stringConverter;

Modified: hive/trunk/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorFilterOperator.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorFilterOperator.java?rev=1535055&r1=1535054&r2=1535055&view=diff
==============================================================================
--- hive/trunk/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorFilterOperator.java (original)
+++ hive/trunk/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorFilterOperator.java Wed Oct 23 15:15:11 2013
@@ -96,7 +96,8 @@ public class TestVectorFilterOperator {
     VectorFilterOperator vfo = getAVectorFilterOperator();
     VectorExpression ve1 = new FilterLongColGreaterLongColumn(0,1);
     VectorExpression ve2 = new FilterLongColEqualDoubleScalar(2, 0);
-    VectorExpression ve3 = new FilterExprAndExpr(ve1,ve2);
+    VectorExpression ve3 = new FilterExprAndExpr();
+    ve3.setChildExpressions(new VectorExpression[] {ve1, ve2});
     vfo.setFilterCondition(ve3);
 
     FakeDataReader fdr = new FakeDataReader(1024*1, 3);
@@ -123,7 +124,8 @@ public class TestVectorFilterOperator {
     VectorFilterOperator vfo = getAVectorFilterOperator();
     VectorExpression ve1 = new FilterLongColGreaterLongColumn(0,1);
     VectorExpression ve2 = new FilterLongColEqualDoubleScalar(2, 0);
-    VectorExpression ve3 = new FilterExprAndExpr(ve1,ve2);
+    VectorExpression ve3 = new FilterExprAndExpr();
+    ve3.setChildExpressions(new VectorExpression[] {ve1, ve2});
     vfo.setFilterCondition(ve3);
 
     FakeDataReader fdr = new FakeDataReader(16*1024*1024, 3);

Modified: hive/trunk/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorizationContext.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorizationContext.java?rev=1535055&r1=1535054&r2=1535055&view=diff
==============================================================================
--- hive/trunk/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorizationContext.java (original)
+++ hive/trunk/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorizationContext.java Wed Oct 23 15:15:11 2013
@@ -26,17 +26,23 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.hadoop.hive.ql.exec.vector.expressions.FilterExprAndExpr;
-import org.apache.hadoop.hive.ql.exec.vector.expressions.FilterExprOrExpr;
-import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression;
+import junit.framework.Assert;
+
+import org.apache.hadoop.hive.ql.exec.vector.expressions.*;
 import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.DoubleColUnaryMinus;
 import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterDoubleColLessDoubleScalar;
 import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterLongColEqualLongScalar;
 import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterLongColGreaterLongScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterLongColLessDoubleScalar;
 import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterLongScalarGreaterLongColumn;
 import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterStringColGreaterStringColumn;
 import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterStringColGreaterStringScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FuncLnDoubleToDouble;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FuncRoundDoubleToDouble;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FuncSinDoubleToDouble;
 import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.LongColAddLongColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.LongColEqualLongScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.LongColGreaterLongScalar;
 import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.LongColModuloLongColumn;
 import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.LongColMultiplyLongColumn;
 import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.LongColSubtractLongColumn;
@@ -48,24 +54,75 @@ import org.apache.hadoop.hive.ql.plan.Ex
 import org.apache.hadoop.hive.ql.plan.ExprNodeDesc;
 import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc;
 import org.apache.hadoop.hive.ql.plan.api.OperatorType;
+import org.apache.hadoop.hive.ql.udf.UDFLTrim;
+import org.apache.hadoop.hive.ql.udf.UDFLog;
 import org.apache.hadoop.hive.ql.udf.UDFOPMinus;
 import org.apache.hadoop.hive.ql.udf.UDFOPMod;
 import org.apache.hadoop.hive.ql.udf.UDFOPMultiply;
 import org.apache.hadoop.hive.ql.udf.UDFOPNegative;
 import org.apache.hadoop.hive.ql.udf.UDFOPPlus;
+import org.apache.hadoop.hive.ql.udf.UDFPower;
+import org.apache.hadoop.hive.ql.udf.UDFRound;
+import org.apache.hadoop.hive.ql.udf.UDFSin;
+import org.apache.hadoop.hive.ql.udf.UDFYear;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDF;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDFBridge;
+import org.apache.hadoop.hive.ql.udf.generic.GenericUDFLower;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPAnd;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPEqual;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPGreaterThan;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPLessThan;
+import org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPNot;
+import org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPNotNull;
+import org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPNull;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPOr;
+import org.apache.hadoop.hive.ql.udf.generic.GenericUDFToUnixTimeStamp;
 import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory;
 import org.junit.Test;
 
 public class TestVectorizationContext {
 
   @Test
+  public void testVectorExpressionDescriptor() {
+    VectorUDFUnixTimeStampLong v1 = new VectorUDFUnixTimeStampLong();
+    VectorExpressionDescriptor.Builder builder1 = new VectorExpressionDescriptor.Builder();
+    VectorExpressionDescriptor.Descriptor d1 = builder1.setMode(VectorExpressionDescriptor.Mode.PROJECTION)
+        .setNumArguments(1).setArgumentTypes(VectorExpressionDescriptor.ArgumentType.LONG)
+        .setInputExpressionTypes(VectorExpressionDescriptor.InputExpressionType.COLUMN).build();
+    Assert.assertEquals(d1, v1.getDescriptor());
+
+    VectorExpressionDescriptor.Builder builder2 = new VectorExpressionDescriptor.Builder();
+    VectorExpressionDescriptor.Descriptor d2 = builder2.setMode(VectorExpressionDescriptor.Mode.FILTER)
+        .setNumArguments(2).setArgumentTypes(VectorExpressionDescriptor.ArgumentType.LONG,
+            VectorExpressionDescriptor.ArgumentType.DOUBLE).setInputExpressionTypes(
+            VectorExpressionDescriptor.InputExpressionType.COLUMN,
+            VectorExpressionDescriptor.InputExpressionType.SCALAR).build();
+    FilterLongColLessDoubleScalar v2 = new FilterLongColLessDoubleScalar();
+    Assert.assertEquals(d2, v2.getDescriptor());
+
+    VectorExpressionDescriptor.Builder builder3 = new VectorExpressionDescriptor.Builder();
+    VectorExpressionDescriptor.Descriptor d3 = builder3.setMode(VectorExpressionDescriptor.Mode.PROJECTION)
+        .setNumArguments(1).setArgumentTypes(VectorExpressionDescriptor.ArgumentType.STRING)
+        .setInputExpressionTypes(VectorExpressionDescriptor.InputExpressionType.COLUMN).build();
+    StringLower v3 = new StringLower();
+    Assert.assertEquals(d3, v3.getDescriptor());
+
+    VectorExpressionDescriptor.Builder builder4 = new VectorExpressionDescriptor.Builder();
+    VectorExpressionDescriptor.Descriptor d4 = builder4.setMode(VectorExpressionDescriptor.Mode.PROJECTION)
+        .setNumArguments(1).setArgumentTypes(VectorExpressionDescriptor.ArgumentType.ANY)
+        .setInputExpressionTypes(VectorExpressionDescriptor.InputExpressionType.COLUMN).build();
+    StringUpper v4 = new StringUpper();
+    Assert.assertEquals(d4, v4.getDescriptor());
+
+    VectorExpressionDescriptor.Builder builder5 = new VectorExpressionDescriptor.Builder();
+    VectorExpressionDescriptor.Descriptor d5 = builder5.setMode(VectorExpressionDescriptor.Mode.PROJECTION)
+        .setNumArguments(1).setArgumentTypes(VectorExpressionDescriptor.ArgumentType.STRING)
+        .setInputExpressionTypes(VectorExpressionDescriptor.InputExpressionType.COLUMN).build();
+    IsNull v5 = new IsNull();
+    Assert.assertEquals(d5, v5.getDescriptor());
+  }
+
+  @Test
   public void testArithmeticExpressionVectorization() throws HiveException {
     /**
      * Create original expression tree for following
@@ -78,14 +135,19 @@ public class TestVectorizationContext {
     GenericUDFBridge udf5 = new GenericUDFBridge("%", true, UDFOPMod.class.getCanonicalName());
 
     ExprNodeGenericFuncDesc sumExpr = new ExprNodeGenericFuncDesc();
+    sumExpr.setTypeInfo(TypeInfoFactory.intTypeInfo);
     sumExpr.setGenericUDF(udf1);
     ExprNodeGenericFuncDesc minusExpr = new ExprNodeGenericFuncDesc();
+    minusExpr.setTypeInfo(TypeInfoFactory.intTypeInfo);
     minusExpr.setGenericUDF(udf2);
     ExprNodeGenericFuncDesc multiplyExpr = new ExprNodeGenericFuncDesc();
+    multiplyExpr.setTypeInfo(TypeInfoFactory.intTypeInfo);
     multiplyExpr.setGenericUDF(udf3);
     ExprNodeGenericFuncDesc sum2Expr = new ExprNodeGenericFuncDesc();
+    sum2Expr.setTypeInfo(TypeInfoFactory.intTypeInfo);
     sum2Expr.setGenericUDF(udf4);
     ExprNodeGenericFuncDesc modExpr = new ExprNodeGenericFuncDesc();
+    modExpr.setTypeInfo(TypeInfoFactory.intTypeInfo);
     modExpr.setGenericUDF(udf5);
 
     ExprNodeColumnDesc col1Expr = new  ExprNodeColumnDesc(Long.class, "col1", "table", false);
@@ -132,7 +194,7 @@ public class TestVectorizationContext {
     //Generate vectorized expression
     VectorizationContext vc = new VectorizationContext(columnMap, 6);
 
-    VectorExpression ve = vc.getVectorExpression(sumExpr);
+    VectorExpression ve = vc.getVectorExpression(sumExpr, VectorExpressionDescriptor.Mode.PROJECTION);
 
     //Verify vectorized expression
     assertTrue(ve instanceof LongColAddLongColumn);
@@ -172,9 +234,8 @@ public class TestVectorizationContext {
     columnMap.put("col2", 2);
 
     VectorizationContext vc = new VectorizationContext(columnMap, 2);
-    vc.setOperatorType(OperatorType.FILTER);
 
-    VectorExpression ve = vc.getVectorExpression(exprDesc);
+    VectorExpression ve = vc.getVectorExpression(exprDesc, VectorExpressionDescriptor.Mode.FILTER);
 
     assertTrue(ve instanceof FilterStringColGreaterStringScalar);
   }
@@ -197,9 +258,8 @@ public class TestVectorizationContext {
     columnMap.put("col2", 2);
 
     VectorizationContext vc = new VectorizationContext(columnMap, 2);
-    vc.setOperatorType(OperatorType.FILTER);
 
-    VectorExpression ve = vc.getVectorExpression(exprDesc);
+    VectorExpression ve = vc.getVectorExpression(exprDesc, VectorExpressionDescriptor.Mode.FILTER);
 
     assertTrue(ve instanceof FilterStringColGreaterStringColumn);
   }
@@ -222,20 +282,20 @@ public class TestVectorizationContext {
     columnMap.put("col1", 0);
 
     VectorizationContext vc = new VectorizationContext(columnMap, 2);
-    vc.setOperatorType(OperatorType.SELECT);
 
-    VectorExpression ve = vc.getVectorExpression(exprDesc);
+    VectorExpression ve = vc.getVectorExpression(exprDesc, VectorExpressionDescriptor.Mode.PROJECTION);
 
     assertTrue(ve.getOutputType().equalsIgnoreCase("double"));
   }
 
   @Test
-  public void testVectorizeAndOrExpression() throws HiveException {
+  public void testVectorizeFilterAndOrExpression() throws HiveException {
     ExprNodeColumnDesc col1Expr = new ExprNodeColumnDesc(Integer.class, "col1", "table", false);
     ExprNodeConstantDesc constDesc = new ExprNodeConstantDesc(new Integer(10));
 
     GenericUDFOPGreaterThan udf = new GenericUDFOPGreaterThan();
     ExprNodeGenericFuncDesc greaterExprDesc = new ExprNodeGenericFuncDesc();
+    greaterExprDesc.setTypeInfo(TypeInfoFactory.booleanTypeInfo);
     greaterExprDesc.setGenericUDF(udf);
     List<ExprNodeDesc> children1 = new ArrayList<ExprNodeDesc>(2);
     children1.add(col1Expr);
@@ -247,6 +307,7 @@ public class TestVectorizationContext {
 
     GenericUDFOPLessThan udf2 = new GenericUDFOPLessThan();
     ExprNodeGenericFuncDesc lessExprDesc = new ExprNodeGenericFuncDesc();
+    lessExprDesc.setTypeInfo(TypeInfoFactory.booleanTypeInfo);
     lessExprDesc.setGenericUDF(udf2);
     List<ExprNodeDesc> children2 = new ArrayList<ExprNodeDesc>(2);
     children2.add(col2Expr);
@@ -255,6 +316,7 @@ public class TestVectorizationContext {
 
     GenericUDFOPAnd andUdf = new GenericUDFOPAnd();
     ExprNodeGenericFuncDesc andExprDesc = new ExprNodeGenericFuncDesc();
+    andExprDesc.setTypeInfo(TypeInfoFactory.booleanTypeInfo);
     andExprDesc.setGenericUDF(andUdf);
     List<ExprNodeDesc> children3 = new ArrayList<ExprNodeDesc>(2);
     children3.add(greaterExprDesc);
@@ -266,9 +328,8 @@ public class TestVectorizationContext {
     columnMap.put("col2", 1);
 
     VectorizationContext vc = new VectorizationContext(columnMap, 2);
-    vc.setOperatorType(OperatorType.FILTER);
 
-    VectorExpression ve = vc.getVectorExpression(andExprDesc);
+    VectorExpression ve = vc.getVectorExpression(andExprDesc, VectorExpressionDescriptor.Mode.FILTER);
 
     assertEquals(ve.getClass(), FilterExprAndExpr.class);
     assertEquals(ve.getChildExpressions()[0].getClass(), FilterLongColGreaterLongScalar.class);
@@ -276,18 +337,204 @@ public class TestVectorizationContext {
 
     GenericUDFOPOr orUdf = new GenericUDFOPOr();
     ExprNodeGenericFuncDesc orExprDesc = new ExprNodeGenericFuncDesc();
+    orExprDesc.setTypeInfo(TypeInfoFactory.booleanTypeInfo);
     orExprDesc.setGenericUDF(orUdf);
     List<ExprNodeDesc> children4 = new ArrayList<ExprNodeDesc>(2);
     children4.add(greaterExprDesc);
     children4.add(lessExprDesc);
     orExprDesc.setChildren(children4);
+    VectorExpression veOr = vc.getVectorExpression(orExprDesc, VectorExpressionDescriptor.Mode.FILTER);
+    assertEquals(veOr.getClass(), FilterExprOrExpr.class);
+    assertEquals(veOr.getChildExpressions()[0].getClass(), FilterLongColGreaterLongScalar.class);
+    assertEquals(veOr.getChildExpressions()[1].getClass(), FilterDoubleColLessDoubleScalar.class);
+  }
+
+  @Test
+  public void testVectorizeAndOrProjectionExpression() throws HiveException {
+    ExprNodeColumnDesc col1Expr = new ExprNodeColumnDesc(Integer.class, "col1", "table", false);
+    ExprNodeConstantDesc constDesc = new ExprNodeConstantDesc(new Integer(10));
+
+    GenericUDFOPGreaterThan udf = new GenericUDFOPGreaterThan();
+    ExprNodeGenericFuncDesc greaterExprDesc = new ExprNodeGenericFuncDesc();
+    greaterExprDesc.setTypeInfo(TypeInfoFactory.booleanTypeInfo);
+    greaterExprDesc.setGenericUDF(udf);
+    List<ExprNodeDesc> children1 = new ArrayList<ExprNodeDesc>(2);
+    children1.add(col1Expr);
+    children1.add(constDesc);
+    greaterExprDesc.setChildren(children1);
+
+    ExprNodeColumnDesc col2Expr = new ExprNodeColumnDesc(Boolean.class, "col2", "table", false);
 
+    GenericUDFOPAnd andUdf = new GenericUDFOPAnd();
+    ExprNodeGenericFuncDesc andExprDesc = new ExprNodeGenericFuncDesc();
+    andExprDesc.setTypeInfo(TypeInfoFactory.booleanTypeInfo);
+    andExprDesc.setGenericUDF(andUdf);
+    List<ExprNodeDesc> children3 = new ArrayList<ExprNodeDesc>(2);
+    children3.add(greaterExprDesc);
+    children3.add(col2Expr);
+    andExprDesc.setChildren(children3);
 
-    VectorExpression veOr = vc.getVectorExpression(orExprDesc);
+    Map<String, Integer> columnMap = new HashMap<String, Integer>();
+    columnMap.put("col1", 0);
+    columnMap.put("col2", 1);
+
+    VectorizationContext vc = new VectorizationContext(columnMap, 2);
+    VectorExpression veAnd = vc.getVectorExpression(andExprDesc, VectorExpressionDescriptor.Mode.FILTER);
+    assertEquals(veAnd.getClass(), FilterExprAndExpr.class);
+    assertEquals(veAnd.getChildExpressions()[0].getClass(), FilterLongColGreaterLongScalar.class);
+    assertEquals(veAnd.getChildExpressions()[1].getClass(), SelectColumnIsTrue.class);
+
+    veAnd = vc.getVectorExpression(andExprDesc, VectorExpressionDescriptor.Mode.PROJECTION);
+    assertEquals(veAnd.getClass(), ColAndCol.class);
+    assertEquals(1, veAnd.getChildExpressions().length);
+    assertEquals(veAnd.getChildExpressions()[0].getClass(), LongColGreaterLongScalar.class);
+    assertEquals(2, ((ColAndCol) veAnd).getColNum1());
+    assertEquals(1, ((ColAndCol) veAnd).getColNum2());
+    assertEquals(3, ((ColAndCol) veAnd).getOutputColumn());
+
+    //OR
+    GenericUDFOPOr orUdf = new GenericUDFOPOr();
+    ExprNodeGenericFuncDesc orExprDesc = new ExprNodeGenericFuncDesc();
+    orExprDesc.setTypeInfo(TypeInfoFactory.booleanTypeInfo);
+    orExprDesc.setGenericUDF(orUdf);
+    List<ExprNodeDesc> children4 = new ArrayList<ExprNodeDesc>(2);
+    children4.add(greaterExprDesc);
+    children4.add(col2Expr);
+    orExprDesc.setChildren(children4);
 
+    //Allocate new Vectorization context to reset the intermediate columns.
+    vc = new VectorizationContext(columnMap, 2);
+    VectorExpression veOr = vc.getVectorExpression(orExprDesc, VectorExpressionDescriptor.Mode.FILTER);
     assertEquals(veOr.getClass(), FilterExprOrExpr.class);
     assertEquals(veOr.getChildExpressions()[0].getClass(), FilterLongColGreaterLongScalar.class);
-    assertEquals(veOr.getChildExpressions()[1].getClass(), FilterDoubleColLessDoubleScalar.class);
+    assertEquals(veOr.getChildExpressions()[1].getClass(), SelectColumnIsTrue.class);
+
+    veOr = vc.getVectorExpression(orExprDesc, VectorExpressionDescriptor.Mode.PROJECTION);
+    assertEquals(veOr.getClass(), ColOrCol.class);
+    assertEquals(1, veAnd.getChildExpressions().length);
+    assertEquals(veAnd.getChildExpressions()[0].getClass(), LongColGreaterLongScalar.class);
+    assertEquals(2, ((ColOrCol) veOr).getColNum1());
+    assertEquals(1, ((ColOrCol) veOr).getColNum2());
+    assertEquals(3, ((ColOrCol) veOr).getOutputColumn());
+  }
+
+  @Test
+  public void testNotExpression() throws HiveException {
+    ExprNodeColumnDesc col1Expr = new ExprNodeColumnDesc(Integer.class, "col1", "table", false);
+    ExprNodeConstantDesc constDesc = new ExprNodeConstantDesc(new Integer(10));
+
+    GenericUDFOPGreaterThan udf = new GenericUDFOPGreaterThan();
+    ExprNodeGenericFuncDesc greaterExprDesc = new ExprNodeGenericFuncDesc();
+    greaterExprDesc.setTypeInfo(TypeInfoFactory.booleanTypeInfo);
+    greaterExprDesc.setGenericUDF(udf);
+    List<ExprNodeDesc> children1 = new ArrayList<ExprNodeDesc>(2);
+    children1.add(col1Expr);
+    children1.add(constDesc);
+    greaterExprDesc.setChildren(children1);
+
+    ExprNodeGenericFuncDesc notExpr = new ExprNodeGenericFuncDesc();
+    notExpr.setTypeInfo(TypeInfoFactory.booleanTypeInfo);
+    GenericUDFOPNot notUdf = new GenericUDFOPNot();
+    notExpr.setGenericUDF(notUdf);
+    List<ExprNodeDesc> childOfNot = new ArrayList<ExprNodeDesc>();
+    childOfNot.add(greaterExprDesc);
+    notExpr.setChildren(childOfNot);
+
+    Map<String, Integer> columnMap = new HashMap<String, Integer>();
+    columnMap.put("col1", 0);
+    columnMap.put("col2", 1);
+
+    VectorizationContext vc = new VectorizationContext(columnMap, 2);
+
+    VectorExpression ve = vc.getVectorExpression(notExpr, VectorExpressionDescriptor.Mode.FILTER);
+
+    assertEquals(ve.getClass(), SelectColumnIsFalse.class);
+    assertEquals(ve.getChildExpressions()[0].getClass(), LongColGreaterLongScalar.class);
+
+    ve = vc.getVectorExpression(notExpr, VectorExpressionDescriptor.Mode.PROJECTION);
+    assertEquals(ve.getClass(), NotCol.class);
+    assertEquals(ve.getChildExpressions()[0].getClass(), LongColGreaterLongScalar.class);
+  }
+
+  @Test
+  public void testNullExpressions() throws HiveException {
+    ExprNodeColumnDesc col1Expr = new ExprNodeColumnDesc(Integer.class, "col1", "table", false);
+    ExprNodeConstantDesc constDesc = new ExprNodeConstantDesc(new Integer(10));
+
+    GenericUDFOPGreaterThan udf = new GenericUDFOPGreaterThan();
+    ExprNodeGenericFuncDesc greaterExprDesc = new ExprNodeGenericFuncDesc();
+    greaterExprDesc.setTypeInfo(TypeInfoFactory.booleanTypeInfo);
+    greaterExprDesc.setGenericUDF(udf);
+    List<ExprNodeDesc> children1 = new ArrayList<ExprNodeDesc>(2);
+    children1.add(col1Expr);
+    children1.add(constDesc);
+    greaterExprDesc.setChildren(children1);
+
+    ExprNodeGenericFuncDesc isNullExpr = new ExprNodeGenericFuncDesc();
+    isNullExpr.setTypeInfo(TypeInfoFactory.booleanTypeInfo);
+    GenericUDFOPNull isNullUdf = new GenericUDFOPNull();
+    isNullExpr.setGenericUDF(isNullUdf);
+    List<ExprNodeDesc> childOfIsNull = new ArrayList<ExprNodeDesc>();
+    childOfIsNull.add(greaterExprDesc);
+    isNullExpr.setChildren(childOfIsNull);
+
+    Map<String, Integer> columnMap = new HashMap<String, Integer>();
+    columnMap.put("col1", 0);
+    columnMap.put("col2", 1);
+
+    VectorizationContext vc = new VectorizationContext(columnMap, 2);
+
+    VectorExpression ve = vc.getVectorExpression(isNullExpr, VectorExpressionDescriptor.Mode.FILTER);
+
+    assertEquals(ve.getClass(), SelectColumnIsNull.class);
+    assertEquals(ve.getChildExpressions()[0].getClass(), LongColGreaterLongScalar.class);
+    assertEquals(2, ve.getChildExpressions()[0].getOutputColumn());
+    assertEquals(2, ((SelectColumnIsNull) ve).getColNum());
+
+    ve = vc.getVectorExpression(isNullExpr, VectorExpressionDescriptor.Mode.PROJECTION);
+    assertEquals(ve.getClass(), IsNull.class);
+    assertEquals(2, ((IsNull) ve).getColNum());
+    assertEquals(ve.getChildExpressions()[0].getClass(), LongColGreaterLongScalar.class);
+  }
+
+  @Test
+  public void testNotNullExpressions() throws HiveException {
+    ExprNodeColumnDesc col1Expr = new ExprNodeColumnDesc(Integer.class, "col1", "table", false);
+    ExprNodeConstantDesc constDesc = new ExprNodeConstantDesc(new Integer(10));
+
+    GenericUDFOPGreaterThan udf = new GenericUDFOPGreaterThan();
+    ExprNodeGenericFuncDesc greaterExprDesc = new ExprNodeGenericFuncDesc();
+    greaterExprDesc.setTypeInfo(TypeInfoFactory.booleanTypeInfo);
+    greaterExprDesc.setGenericUDF(udf);
+    List<ExprNodeDesc> children1 = new ArrayList<ExprNodeDesc>(2);
+    children1.add(col1Expr);
+    children1.add(constDesc);
+    greaterExprDesc.setChildren(children1);
+
+    ExprNodeGenericFuncDesc isNotNullExpr = new ExprNodeGenericFuncDesc();
+    isNotNullExpr.setTypeInfo(TypeInfoFactory.booleanTypeInfo);
+    GenericUDFOPNotNull notNullUdf = new GenericUDFOPNotNull();
+    isNotNullExpr.setGenericUDF(notNullUdf);
+    List<ExprNodeDesc> childOfNot = new ArrayList<ExprNodeDesc>();
+    childOfNot.add(greaterExprDesc);
+    isNotNullExpr.setChildren(childOfNot);
+
+    Map<String, Integer> columnMap = new HashMap<String, Integer>();
+    columnMap.put("col1", 0);
+    columnMap.put("col2", 1);
+
+    VectorizationContext vc = new VectorizationContext(columnMap, 2);
+
+    VectorExpression ve = vc.getVectorExpression(isNotNullExpr, VectorExpressionDescriptor.Mode.FILTER);
+
+    assertEquals(ve.getClass(), SelectColumnIsNotNull.class);
+    assertEquals(2, ((SelectColumnIsNotNull) ve).getColNum());
+    assertEquals(ve.getChildExpressions()[0].getClass(), LongColGreaterLongScalar.class);
+
+    ve = vc.getVectorExpression(isNotNullExpr, VectorExpressionDescriptor.Mode.PROJECTION);
+    assertEquals(ve.getClass(), IsNotNull.class);
+    assertEquals(2, ((IsNotNull) ve).getColNum());
+    assertEquals(ve.getChildExpressions()[0].getClass(), LongColGreaterLongScalar.class);
   }
 
   @Test
@@ -308,7 +555,7 @@ public class TestVectorizationContext {
     columnMap.put("a", 0);
 
     VectorizationContext vc = new VectorizationContext(columnMap, 2);
-    VectorExpression ve = vc.getVectorExpression(scalarMinusConstant);
+    VectorExpression ve = vc.getVectorExpression(scalarMinusConstant, VectorExpressionDescriptor.Mode.PROJECTION);
 
     assertEquals(ve.getClass(), LongScalarSubtractLongColumn.class);
   }
@@ -331,9 +578,8 @@ public class TestVectorizationContext {
     columnMap.put("col2", 2);
 
     VectorizationContext vc = new VectorizationContext(columnMap, 2);
-    vc.setOperatorType(OperatorType.FILTER);
 
-    VectorExpression ve = vc.getVectorExpression(exprDesc);
+    VectorExpression ve = vc.getVectorExpression(exprDesc, VectorExpressionDescriptor.Mode.FILTER);
 
     assertTrue(ve instanceof FilterLongColGreaterLongScalar);
   }
@@ -350,9 +596,8 @@ public class TestVectorizationContext {
     Map<String, Integer> columnMap = new HashMap<String, Integer>();
     columnMap.put("col1", 1);
     VectorizationContext vc = new VectorizationContext(columnMap, 1);
-    vc.setOperatorType(OperatorType.SELECT);
 
-    VectorExpression ve = vc.getVectorExpression(negExprDesc);
+    VectorExpression ve = vc.getVectorExpression(negExprDesc, VectorExpressionDescriptor.Mode.PROJECTION);
 
     assertTrue( ve instanceof LongColUnaryMinus);
   }
@@ -369,9 +614,8 @@ public class TestVectorizationContext {
     Map<String, Integer> columnMap = new HashMap<String, Integer>();
     columnMap.put("col1", 1);
     VectorizationContext vc = new VectorizationContext(columnMap, 1);
-    vc.setOperatorType(OperatorType.SELECT);
 
-    VectorExpression ve = vc.getVectorExpression(negExprDesc);
+    VectorExpression ve = vc.getVectorExpression(negExprDesc, VectorExpressionDescriptor.Mode.PROJECTION);
 
     assertTrue( ve instanceof DoubleColUnaryMinus);
   }
@@ -396,8 +640,7 @@ public class TestVectorizationContext {
     columnMap.put("a", 0);
 
     VectorizationContext vc = new VectorizationContext(columnMap, 2);
-    vc.setOperatorType(OperatorType.FILTER);
-    VectorExpression ve = vc.getVectorExpression(scalarGreaterColExpr);
+    VectorExpression ve = vc.getVectorExpression(scalarGreaterColExpr, VectorExpressionDescriptor.Mode.FILTER);
     assertEquals(FilterLongScalarGreaterLongColumn.class, ve.getClass());
   }
 
@@ -421,8 +664,199 @@ public class TestVectorizationContext {
     columnMap.put("a", 0);
 
     VectorizationContext vc = new VectorizationContext(columnMap, 2);
-    vc.setOperatorType(OperatorType.FILTER);
-    VectorExpression ve = vc.getVectorExpression(colEqualScalar);
+    VectorExpression ve = vc.getVectorExpression(colEqualScalar, VectorExpressionDescriptor.Mode.FILTER);
     assertEquals(FilterLongColEqualLongScalar.class, ve.getClass());
   }
+
+  @Test
+  public void testBooleanColumnCompareBooleanScalar() throws HiveException {
+    ExprNodeGenericFuncDesc colEqualScalar = new ExprNodeGenericFuncDesc();
+    GenericUDFOPEqual gudf = new GenericUDFOPEqual();
+    colEqualScalar.setGenericUDF(gudf);
+    List<ExprNodeDesc> children = new ArrayList<ExprNodeDesc>(2);
+    ExprNodeConstantDesc constDesc =
+        new ExprNodeConstantDesc(TypeInfoFactory.booleanTypeInfo, 20);
+    ExprNodeColumnDesc colDesc =
+        new ExprNodeColumnDesc(Boolean.class, "a", "table", false);
+
+    children.add(colDesc);
+    children.add(constDesc);
+
+    colEqualScalar.setChildren(children);
+
+    Map<String, Integer> columnMap = new HashMap<String, Integer>();
+    columnMap.put("a", 0);
+    VectorizationContext vc = new VectorizationContext(columnMap, 2);
+    VectorExpression ve = vc.getVectorExpression(colEqualScalar, VectorExpressionDescriptor.Mode.PROJECTION);
+    assertEquals(LongColEqualLongScalar.class, ve.getClass());
+  }
+
+  @Test
+  public void testUnaryStringExpressions() throws HiveException {
+    ExprNodeGenericFuncDesc stringUnary = new ExprNodeGenericFuncDesc();
+    stringUnary.setTypeInfo(TypeInfoFactory.stringTypeInfo);
+    ExprNodeColumnDesc colDesc = new ExprNodeColumnDesc(String.class, "a", "table", false);
+    List<ExprNodeDesc> children = new ArrayList<ExprNodeDesc>();
+    children.add(colDesc);
+    stringUnary.setChildren(children);
+
+    Map<String, Integer> columnMap = new HashMap<String, Integer>();
+    columnMap.put("b", 0);
+    columnMap.put("a", 1);
+    VectorizationContext vc = new VectorizationContext(columnMap, 2);
+
+    GenericUDF stringLower = new GenericUDFLower();
+    stringUnary.setGenericUDF(stringLower);
+
+    VectorExpression ve = vc.getVectorExpression(stringUnary);
+
+    assertEquals(StringLower.class, ve.getClass());
+    assertEquals(1, ((StringLower) ve).getColNum());
+    assertEquals(2, ((StringLower) ve).getOutputColumn());
+
+    vc = new VectorizationContext(columnMap, 2);
+
+    ExprNodeGenericFuncDesc anotherUnary = new ExprNodeGenericFuncDesc();
+    anotherUnary.setTypeInfo(TypeInfoFactory.stringTypeInfo);
+    List<ExprNodeDesc> children2 = new ArrayList<ExprNodeDesc>();
+    children2.add(stringUnary);
+    anotherUnary.setChildren(children2);
+    GenericUDFBridge udfbridge = new GenericUDFBridge("ltrim", false, UDFLTrim.class.getName());
+    anotherUnary.setGenericUDF(udfbridge);
+
+    ve = vc.getVectorExpression(anotherUnary);
+    VectorExpression childVe = ve.getChildExpressions()[0];
+    assertEquals(StringLower.class, childVe.getClass());
+    assertEquals(1, ((StringLower) childVe).getColNum());
+    assertEquals(2, ((StringLower) childVe).getOutputColumn());
+
+    assertEquals(StringLTrim.class, ve.getClass());
+    assertEquals(2, ((StringLTrim) ve).getInputColumn());
+    assertEquals(3, ((StringLTrim) ve).getOutputColumn());
+  }
+
+  @Test
+  public void testMathFunctions() throws HiveException {
+    ExprNodeGenericFuncDesc mathFuncExpr = new ExprNodeGenericFuncDesc();
+    mathFuncExpr.setTypeInfo(TypeInfoFactory.doubleTypeInfo);
+    ExprNodeColumnDesc colDesc1 = new ExprNodeColumnDesc(Integer.class, "a", "table", false);
+    ExprNodeColumnDesc colDesc2 = new ExprNodeColumnDesc(Double.class, "b", "table", false);
+    List<ExprNodeDesc> children1 = new ArrayList<ExprNodeDesc>();
+    List<ExprNodeDesc> children2 = new ArrayList<ExprNodeDesc>();
+    children1.add(colDesc1);
+    children2.add(colDesc2);
+
+    Map<String, Integer> columnMap = new HashMap<String, Integer>();
+    columnMap.put("b", 0);
+    columnMap.put("a", 1);
+    VectorizationContext vc = new VectorizationContext(columnMap, 2);
+
+    // Sin(double)
+    GenericUDFBridge gudfBridge = new GenericUDFBridge("sin", false, UDFSin.class.getName());
+    mathFuncExpr.setGenericUDF(gudfBridge);
+    mathFuncExpr.setChildren(children2);
+    VectorExpression ve = vc.getVectorExpression(mathFuncExpr, VectorExpressionDescriptor.Mode.PROJECTION);
+    Assert.assertEquals(FuncSinDoubleToDouble.class, ve.getClass());
+
+    // Round without digits
+    gudfBridge = new GenericUDFBridge("round", false, UDFRound.class.getName());
+    mathFuncExpr.setGenericUDF(gudfBridge);
+    mathFuncExpr.setChildren(children2);
+    ve = vc.getVectorExpression(mathFuncExpr);
+    Assert.assertEquals(FuncRoundDoubleToDouble.class, ve.getClass());
+
+    // Round with digits
+    gudfBridge = new GenericUDFBridge("round", false, UDFRound.class.getName());
+    mathFuncExpr.setGenericUDF(gudfBridge);
+    children2.add(new ExprNodeConstantDesc(4));
+    mathFuncExpr.setChildren(children2);
+    ve = vc.getVectorExpression(mathFuncExpr);
+    Assert.assertEquals(RoundWithNumDigitsDoubleToDouble.class, ve.getClass());
+    Assert.assertEquals(4, ((RoundWithNumDigitsDoubleToDouble) ve).getDecimalPlaces().get());
+
+    // Log with int base
+    gudfBridge = new GenericUDFBridge("log", false, UDFLog.class.getName());
+    mathFuncExpr.setGenericUDF(gudfBridge);
+    children2.clear();
+    children2.add(new ExprNodeConstantDesc(4.0));
+    children2.add(colDesc2);
+    mathFuncExpr.setChildren(children2);
+    ve = vc.getVectorExpression(mathFuncExpr);
+    Assert.assertEquals(FuncLogWithBaseDoubleToDouble.class, ve.getClass());
+    Assert.assertTrue(4 == ((FuncLogWithBaseDoubleToDouble) ve).getBase());
+
+    // Log with default base
+    children2.clear();
+    children2.add(colDesc2);
+    mathFuncExpr.setChildren(children2);
+    ve = vc.getVectorExpression(mathFuncExpr);
+    Assert.assertEquals(FuncLnDoubleToDouble.class, ve.getClass());
+
+    //Log with double base
+    children2.clear();
+    children2.add(new ExprNodeConstantDesc(4.5));
+    children2.add(colDesc2);
+    mathFuncExpr.setChildren(children2);
+    ve = vc.getVectorExpression(mathFuncExpr);
+    Assert.assertEquals(FuncLogWithBaseDoubleToDouble.class, ve.getClass());
+    Assert.assertTrue(4.5 == ((FuncLogWithBaseDoubleToDouble) ve).getBase());
+
+    //Log with int input and double base
+    children2.clear();
+    children2.add(new ExprNodeConstantDesc(4.5));
+    children2.add(colDesc1);
+    mathFuncExpr.setChildren(children2);
+    ve = vc.getVectorExpression(mathFuncExpr);
+    Assert.assertEquals(FuncLogWithBaseLongToDouble.class, ve.getClass());
+    Assert.assertTrue(4.5 == ((FuncLogWithBaseLongToDouble) ve).getBase());
+
+    //Power with double power
+    gudfBridge = new GenericUDFBridge("power", false, UDFPower.class.getName());
+    children2.clear();
+    children2.add(colDesc2);
+    children2.add(new ExprNodeConstantDesc(4.5));
+    mathFuncExpr.setGenericUDF(gudfBridge);
+    mathFuncExpr.setChildren(children2);
+    ve = vc.getVectorExpression(mathFuncExpr);
+    Assert.assertEquals(FuncPowerDoubleToDouble.class, ve.getClass());
+    Assert.assertTrue(4.5 == ((FuncPowerDoubleToDouble) ve).getPower());
+
+    //Round with default decimal places
+    gudfBridge = new GenericUDFBridge("round", false, UDFRound.class.getName());
+    mathFuncExpr.setGenericUDF(gudfBridge);
+    children2.clear();
+    children2.add(colDesc2);
+    mathFuncExpr.setChildren(children2);
+    ve = vc.getVectorExpression(mathFuncExpr);
+    Assert.assertEquals(FuncRoundDoubleToDouble.class, ve.getClass());
+  }
+
+  @Test
+  public void testTimeStampUdfs() throws HiveException {
+    ExprNodeGenericFuncDesc tsFuncExpr = new ExprNodeGenericFuncDesc();
+    tsFuncExpr.setTypeInfo(TypeInfoFactory.intTypeInfo);
+    ExprNodeColumnDesc colDesc1 = new ExprNodeColumnDesc(
+        TypeInfoFactory.timestampTypeInfo, "a", "table", false);
+    List<ExprNodeDesc> children = new ArrayList<ExprNodeDesc>();
+    children.add(colDesc1);
+
+    Map<String, Integer> columnMap = new HashMap<String, Integer>();
+    columnMap.put("b", 0);
+    columnMap.put("a", 1);
+    VectorizationContext vc = new VectorizationContext(columnMap, 2);
+
+    //UDFYear
+    GenericUDFBridge gudfBridge = new GenericUDFBridge("year", false, UDFYear.class.getName());
+    tsFuncExpr.setGenericUDF(gudfBridge);
+    tsFuncExpr.setChildren(children);
+    VectorExpression ve = vc.getVectorExpression(tsFuncExpr);
+    Assert.assertEquals(VectorUDFYearLong.class, ve.getClass());
+
+    //GenericUDFToUnixTimeStamp
+    GenericUDFToUnixTimeStamp gudf = new GenericUDFToUnixTimeStamp();
+    tsFuncExpr.setGenericUDF(gudf);
+    tsFuncExpr.setTypeInfo(TypeInfoFactory.longTypeInfo);
+    ve = vc.getVectorExpression(tsFuncExpr);
+    Assert.assertEquals(VectorUDFUnixTimeStampLong.class, ve.getClass());
+  }
 }

Modified: hive/trunk/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorFilterExpressions.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorFilterExpressions.java?rev=1535055&r1=1535054&r2=1535055&view=diff
==============================================================================
--- hive/trunk/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorFilterExpressions.java (original)
+++ hive/trunk/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorFilterExpressions.java Wed Oct 23 15:15:11 2013
@@ -181,7 +181,7 @@ public class TestVectorFilterExpressions
     VectorizedRowBatch vrb = VectorizedRowGroupGenUtil.getVectorizedRowBatch(
         5, 2, seed);
     LongColumnVector lcv0 = (LongColumnVector) vrb.cols[0];
-    FilterLongScalarLessLongColumn expr1 = new FilterLongScalarLessLongColumn(0, 15);
+    FilterLongScalarLessLongColumn expr1 = new FilterLongScalarLessLongColumn(15, 0);
 
     //Basic case
     lcv0.vector[0] = 5;
@@ -197,7 +197,7 @@ public class TestVectorFilterExpressions
     assertEquals(1, vrb.selected[0]);
     assertEquals(2, vrb.selected[1]);
 
-    FilterLongScalarGreaterLongColumn expr2 = new FilterLongScalarGreaterLongColumn(0, 18);
+    FilterLongScalarGreaterLongColumn expr2 = new FilterLongScalarGreaterLongColumn(18, 0);
     expr2.evaluate(vrb);
     assertEquals(1, vrb.size);
     assertTrue(vrb.selectedInUse);

Modified: hive/trunk/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorLogicalExpressions.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorLogicalExpressions.java?rev=1535055&r1=1535054&r2=1535055&view=diff
==============================================================================
--- hive/trunk/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorLogicalExpressions.java (original)
+++ hive/trunk/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorLogicalExpressions.java Wed Oct 23 15:15:11 2013
@@ -347,7 +347,8 @@ public class TestVectorLogicalExpression
     SelectColumnIsTrue expr1 = new SelectColumnIsTrue(0);
     SelectColumnIsFalse expr2 = new SelectColumnIsFalse(1);
 
-    FilterExprOrExpr orExpr = new FilterExprOrExpr(expr1, expr2);
+    FilterExprOrExpr orExpr = new FilterExprOrExpr();
+    orExpr.setChildExpressions(new VectorExpression[] {expr1, expr2});
 
     orExpr.evaluate(batch1);
     orExpr.evaluate(batch2);
@@ -386,7 +387,8 @@ public class TestVectorLogicalExpression
     SelectColumnIsTrue expr1 = new SelectColumnIsTrue(0);
     SelectColumnIsFalse expr2 = new SelectColumnIsFalse(1);
 
-    FilterExprOrExpr orExpr = new FilterExprOrExpr(expr1, expr2);
+    FilterExprOrExpr orExpr = new FilterExprOrExpr();
+    orExpr.setChildExpressions(new VectorExpression[] {expr1, expr2});
 
     orExpr.evaluate(batch1);
 
@@ -419,7 +421,8 @@ public class TestVectorLogicalExpression
     SelectColumnIsTrue expr1 = new SelectColumnIsTrue(0);
     SelectColumnIsFalse expr2 = new SelectColumnIsFalse(1);
 
-    FilterExprOrExpr orExpr = new FilterExprOrExpr(expr1, expr2);
+    FilterExprOrExpr orExpr = new FilterExprOrExpr();
+    orExpr.setChildExpressions(new VectorExpression[] {expr1, expr2});
 
     // Evaluate batch1 so that temporary arrays in the expression
     // have residual values to interfere in later computation
@@ -448,9 +451,10 @@ public class TestVectorLogicalExpression
     SelectColumnIsTrue expr1 = new SelectColumnIsTrue(0);
     SelectColumnIsFalse expr2 = new SelectColumnIsFalse(1);
 
-    FilterExprAndExpr orExpr = new FilterExprAndExpr(expr1, expr2);
+    FilterExprAndExpr andExpr = new FilterExprAndExpr();
+    andExpr.setChildExpressions(new VectorExpression[] {expr1, expr2});
 
-    orExpr.evaluate(batch1);
+    andExpr.evaluate(batch1);
 
     assertEquals(1, batch1.size);
 

Modified: hive/trunk/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorMathFunctions.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorMathFunctions.java?rev=1535055&r1=1535054&r2=1535055&view=diff
==============================================================================
--- hive/trunk/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorMathFunctions.java (original)
+++ hive/trunk/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorMathFunctions.java Wed Oct 23 15:15:11 2013
@@ -18,22 +18,38 @@
 
 package org.apache.hadoop.hive.ql.exec.vector.expressions;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
 import java.io.UnsupportedEncodingException;
 import java.util.Arrays;
 
 import junit.framework.Assert;
 
-import org.apache.hadoop.hbase.client.coprocessor.Batch;
 import org.apache.hadoop.hive.ql.exec.vector.BytesColumnVector;
 import org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector;
 import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector;
 import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch;
-import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.*;
-import org.apache.hadoop.hive.ql.exec.vector.expressions.*;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FuncACosDoubleToDouble;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FuncASinDoubleToDouble;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FuncATanDoubleToDouble;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FuncAbsDoubleToDouble;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FuncAbsLongToLong;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FuncCeilDoubleToLong;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FuncCosDoubleToDouble;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FuncDegreesDoubleToDouble;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FuncExpDoubleToDouble;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FuncFloorDoubleToLong;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FuncLnDoubleToDouble;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FuncLnLongToDouble;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FuncLog10DoubleToDouble;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FuncLog10LongToDouble;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FuncLog2DoubleToDouble;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FuncLog2LongToDouble;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FuncRadiansDoubleToDouble;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FuncRoundDoubleToDouble;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FuncSignDoubleToDouble;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FuncSignLongToDouble;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FuncSinDoubleToDouble;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FuncSqrtDoubleToDouble;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FuncTanDoubleToDouble;
 import org.junit.Test;
 
 
@@ -84,7 +100,7 @@ public class TestVectorMathFunctions {
   @Test
   public void testRoundToDecimalPlaces() {
     VectorizedRowBatch b = getVectorizedRowBatchDoubleInDoubleOut();
-    VectorExpression expr = new RoundWithNumDigitsDoubleToDouble(0, 1);
+    VectorExpression expr = new RoundWithNumDigitsDoubleToDouble(0, 4, 1);
     ((ISetLongArg) expr).setArg(4);  // set number of digits
     expr.evaluate(b);
     DoubleColumnVector resultV = (DoubleColumnVector) b.cols[1];
@@ -386,7 +402,7 @@ public class TestVectorMathFunctions {
     b.size = VectorizedRowBatch.DEFAULT_SIZE;
     int n = b.size;
     v.noNulls = true;
-    VectorExpression expr = new FuncRand(0);
+    VectorExpression expr = new FuncRandNoSeed(0);
     expr.evaluate(b);
     double sum = 0;
     for(int i = 0; i != n; i++) {
@@ -421,7 +437,7 @@ public class TestVectorMathFunctions {
     VectorizedRowBatch b = getVectorizedRowBatchDoubleInDoubleOut();
     DoubleColumnVector resultV = (DoubleColumnVector) b.cols[1];
     b.cols[0].noNulls = true;
-    VectorExpression expr = new FuncLogWithBaseDoubleToDouble(0, 1);
+    VectorExpression expr = new FuncLogWithBaseDoubleToDouble(10.0, 0, 1);
     ((ISetDoubleArg) expr).setArg(10.0d);  // set base
     expr.evaluate(b);
     Assert.assertTrue(equalsWithinTolerance(Math.log(0.5d) / Math.log(10), resultV.vector[4]));
@@ -436,8 +452,8 @@ public class TestVectorMathFunctions {
     DoubleColumnVector resultV = (DoubleColumnVector) b.cols[1];
     b.cols[0].noNulls = true;
     inV.vector[4] = -4.0;
-    VectorExpression expr = new PosModDoubleToDouble(0, 1);
-    ((ISetDoubleArg) expr).setArg(0.3d);  // set base
+    VectorExpression expr = new PosModDoubleToDouble(0, 0.3d, 1);
+    //((ISetDoubleArg) expr).setArg(0.3d);  // set base
     expr.evaluate(b);
     Assert.assertTrue(equalsWithinTolerance(((-4.0d % 0.3d) + 0.3d) % 0.3d, resultV.vector[4]));
 
@@ -445,8 +461,8 @@ public class TestVectorMathFunctions {
     b = getVectorizedRowBatchLongInLongOut();
     LongColumnVector resV2 = (LongColumnVector) b.cols[1];
     b.cols[0].noNulls = true;
-    expr = new PosModLongToLong(0, 1);
-    ((ISetLongArg) expr).setArg(3);
+    expr = new PosModLongToLong(0, 3, 1);
+    //((ISetLongArg) expr).setArg(3);
     expr.evaluate(b);
     Assert.assertEquals(((-2 % 3) + 3) % 3, resV2.vector[0]);
   }
@@ -456,7 +472,7 @@ public class TestVectorMathFunctions {
     VectorizedRowBatch b = getVectorizedRowBatchDoubleInDoubleOut();
     DoubleColumnVector resultV = (DoubleColumnVector) b.cols[1];
     b.cols[0].noNulls = true;
-    VectorExpression expr = new FuncPowerDoubleToDouble(0, 1);
+    VectorExpression expr = new FuncPowerDoubleToDouble(0, 2.0, 1);
     ((ISetDoubleArg) expr).setArg(2.0d);  // set power
     expr.evaluate(b);
     Assert.assertTrue(equalsWithinTolerance(0.5d * 0.5d, resultV.vector[4]));

Modified: hive/trunk/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorStringExpressions.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorStringExpressions.java?rev=1535055&r1=1535054&r2=1535055&view=diff
==============================================================================
--- hive/trunk/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorStringExpressions.java (original)
+++ hive/trunk/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorStringExpressions.java Wed Oct 23 15:15:11 2013
@@ -36,6 +36,7 @@ import org.apache.hadoop.hive.ql.exec.ve
 import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.StringColEqualStringScalar;
 import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.StringColLessStringColumn;
 import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.StringScalarEqualStringColumn;
+import org.apache.hadoop.hive.ql.metadata.HiveException;
 import org.apache.hadoop.io.Text;
 import org.junit.Test;
 
@@ -209,7 +210,7 @@ public class TestVectorStringExpressions
   public void testStringScalarCompareStringCol() {
     VectorizedRowBatch batch = makeStringBatch();
     VectorExpression expr;
-    expr = new FilterStringScalarEqualStringColumn(0, red2);
+    expr = new FilterStringScalarEqualStringColumn(red2, 0);
     expr.evaluate(batch);
 
     // only red qualifies, and it's in entry 0
@@ -217,7 +218,7 @@ public class TestVectorStringExpressions
     Assert.assertTrue(batch.selected[0] == 0);
 
     batch = makeStringBatch();
-    expr = new FilterStringScalarGreaterStringColumn(0, red2);
+    expr = new FilterStringScalarGreaterStringColumn(red2, 0);
     expr.evaluate(batch);
 
     // only green qualifies, and it's in entry 1
@@ -225,7 +226,7 @@ public class TestVectorStringExpressions
     Assert.assertTrue(batch.selected[0] == 1);
 
     batch = makeStringBatch();
-    expr = new FilterStringScalarLessEqualStringColumn(0, green);
+    expr = new FilterStringScalarLessEqualStringColumn(green, 0);
     expr.evaluate(batch);
 
     // green and red qualify
@@ -239,7 +240,7 @@ public class TestVectorStringExpressions
     VectorizedRowBatch batch = makeStringBatch();
     VectorExpression expr;
 
-    expr = new StringScalarEqualStringColumn(0, red2, 2);
+    expr = new StringScalarEqualStringColumn(red2, 0, 2);
     expr.evaluate(batch);
     Assert.assertEquals(3, batch.size);
     LongColumnVector outVector = (LongColumnVector) batch.cols[2];
@@ -248,7 +249,7 @@ public class TestVectorStringExpressions
     Assert.assertEquals(0, outVector.vector[2]);
 
     batch = makeStringBatch();
-    expr = new StringScalarEqualStringColumn(0, green, 2);
+    expr = new StringScalarEqualStringColumn(green, 0, 2);
     expr.evaluate(batch);
     Assert.assertEquals(3, batch.size);
     outVector = (LongColumnVector) batch.cols[2];
@@ -920,7 +921,7 @@ public class TestVectorStringExpressions
   }
 
   @Test
-  public void testStringLike() {
+  public void testStringLike() throws HiveException {
 
     // has nulls, not repeating
     VectorizedRowBatch batch;
@@ -928,7 +929,7 @@ public class TestVectorStringExpressions
     int initialBatchSize;
     batch = makeStringBatchMixedCharSize();
     pattern = new Text(mixPercentPattern);
-    FilterStringColLikeStringScalar expr = new FilterStringColLikeStringScalar(0, pattern);
+    FilterStringColLikeStringScalar expr = new FilterStringColLikeStringScalar(0, mixPercentPattern);
     expr.evaluate(batch);
 
     // verify that the beginning entry is the only one that matches
@@ -973,48 +974,48 @@ public class TestVectorStringExpressions
     Assert.assertEquals(initialBatchSize, batch.size);
   }
 
-  public void testStringLikePatternType() {
+  public void testStringLikePatternType() throws UnsupportedEncodingException, HiveException {
     FilterStringColLikeStringScalar expr;
 
     // BEGIN pattern
-    expr = new FilterStringColLikeStringScalar(0, new Text("abc%"));
+    expr = new FilterStringColLikeStringScalar(0, "abc%".getBytes());
     Assert.assertEquals(FilterStringColLikeStringScalar.BeginChecker.class,
         expr.checker.getClass());
 
     // END pattern
-    expr = new FilterStringColLikeStringScalar(0, new Text("%abc"));
+    expr = new FilterStringColLikeStringScalar(0, "%abc".getBytes("UTF-8"));
     Assert.assertEquals(FilterStringColLikeStringScalar.EndChecker.class,
         expr.checker.getClass());
 
     // MIDDLE pattern
-    expr = new FilterStringColLikeStringScalar(0, new Text("%abc%"));
+    expr = new FilterStringColLikeStringScalar(0, "%abc%".getBytes());
     Assert.assertEquals(FilterStringColLikeStringScalar.MiddleChecker.class,
         expr.checker.getClass());
 
     // COMPLEX pattern
-    expr = new FilterStringColLikeStringScalar(0, new Text("%abc%de"));
+    expr = new FilterStringColLikeStringScalar(0, "%abc%de".getBytes());
     Assert.assertEquals(FilterStringColLikeStringScalar.ComplexChecker.class,
         expr.checker.getClass());
 
     // NONE pattern
-    expr = new FilterStringColLikeStringScalar(0, new Text("abc"));
+    expr = new FilterStringColLikeStringScalar(0, "abc".getBytes());
     Assert.assertEquals(FilterStringColLikeStringScalar.NoneChecker.class,
         expr.checker.getClass());
   }
 
-  public void testStringLikeMultiByte() {
+  public void testStringLikeMultiByte() throws HiveException {
     FilterStringColLikeStringScalar expr;
     VectorizedRowBatch batch;
 
     // verify that a multi byte LIKE expression matches a matching string
     batch = makeStringBatchMixedCharSize();
-    expr = new FilterStringColLikeStringScalar(0, new Text("%" + multiByte + "%"));
+    expr = new FilterStringColLikeStringScalar(0, ("%" + multiByte + "%").getBytes());
     expr.evaluate(batch);
     Assert.assertEquals(batch.size, 1);
 
     // verify that a multi byte LIKE expression doesn't match a non-matching string
     batch = makeStringBatchMixedCharSize();
-    expr = new FilterStringColLikeStringScalar(0, new Text("%" + multiByte + "x"));
+    expr = new FilterStringColLikeStringScalar(0, ("%" + multiByte + "x").getBytes());
     expr.evaluate(batch);
     Assert.assertEquals(batch.size, 0);
   }
@@ -1024,7 +1025,7 @@ public class TestVectorStringExpressions
 
     // has nulls, not repeating
     VectorizedRowBatch batch = makeStringBatch();
-    StringConcatColScalar expr = new StringConcatColScalar(0, 1, red);
+    StringConcatColScalar expr = new StringConcatColScalar(0, red, 1);
     expr.evaluate(batch);
     BytesColumnVector outCol = (BytesColumnVector) batch.cols[1];
 

Added: hive/trunk/ql/src/test/queries/clientpositive/vectorization_0.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientpositive/vectorization_0.q?rev=1535055&view=auto
==============================================================================
--- hive/trunk/ql/src/test/queries/clientpositive/vectorization_0.q (added)
+++ hive/trunk/ql/src/test/queries/clientpositive/vectorization_0.q Wed Oct 23 15:15:11 2013
@@ -0,0 +1,27 @@
+SET hive.vectorized.execution.enabled=true;
+SELECT AVG(cbigint),
+       (-(AVG(cbigint))),
+       (-6432 + AVG(cbigint)),
+       STDDEV_POP(cbigint),
+       (-((-6432 + AVG(cbigint)))),
+       ((-((-6432 + AVG(cbigint)))) + (-6432 + AVG(cbigint))),
+       VAR_SAMP(cbigint),
+       (-((-6432 + AVG(cbigint)))),
+       (-6432 + (-((-6432 + AVG(cbigint))))),
+       (-((-6432 + AVG(cbigint)))),
+       ((-((-6432 + AVG(cbigint)))) / (-((-6432 + AVG(cbigint))))),
+       COUNT(*),
+       SUM(cfloat),
+       (VAR_SAMP(cbigint) % STDDEV_POP(cbigint)),
+       (-(VAR_SAMP(cbigint))),
+       ((-((-6432 + AVG(cbigint)))) * (-(AVG(cbigint)))),
+       MIN(ctinyint),
+       (-(MIN(ctinyint)))
+FROM   alltypesorc
+WHERE  (((cstring2 LIKE '%b%')
+         OR ((79.553 != cint)
+             OR (cbigint < cdouble)))
+        OR ((ctinyint >= csmallint)
+            AND ((cboolean2 = 1)
+                 AND (3569 = ctinyint))));
+



Mime
View raw message