You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by gu...@apache.org on 2014/01/28 06:48:10 UTC

svn commit: r1561947 [13/17] - in /hive/branches/tez: ./ ant/ ant/src/org/apache/hadoop/hive/ant/ beeline/ cli/ cli/src/java/org/apache/hadoop/hive/cli/ common/ common/src/ common/src/java/org/apache/hadoop/hive/common/type/ common/src/java/org/apache/...

Modified: hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorArithmeticExpressions.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorArithmeticExpressions.java?rev=1561947&r1=1561946&r2=1561947&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorArithmeticExpressions.java (original)
+++ hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorArithmeticExpressions.java Tue Jan 28 05:48:03 2014
@@ -31,6 +31,15 @@ import org.apache.hadoop.hive.ql.exec.ve
 import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch;
 import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.LongColAddLongColumn;
 import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.LongColAddLongScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.DecimalColSubtractDecimalColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.DecimalColAddDecimalColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.DecimalColMultiplyDecimalColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.DecimalColAddDecimalScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.DecimalColSubtractDecimalScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.DecimalColMultiplyDecimalScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.DecimalScalarAddDecimalColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.DecimalScalarSubtractDecimalColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.DecimalScalarMultiplyDecimalColumn;
 import org.apache.hadoop.hive.ql.exec.vector.util.VectorizedRowGroupGenUtil;
 import org.junit.Test;
 
@@ -324,6 +333,336 @@ public class TestVectorArithmeticExpress
     assertTrue(r.vector[0].equals(new Decimal128("0.01", (short) 2)));
   }
 
+  // Test decimal column-column addition
+  @Test
+  public void testDecimalColumnAddDecimalColumn() {
+    VectorizedRowBatch b = getVectorizedRowBatch3DecimalCols();
+    VectorExpression expr = new DecimalColAddDecimalColumn(0, 1, 2);
+    DecimalColumnVector r = (DecimalColumnVector) b.cols[2];
+
+    // test without nulls
+    expr.evaluate(b);
+    assertTrue(r.vector[0].equals(new Decimal128("2.20", (short) 2)));
+    assertTrue(r.vector[1].equals(new Decimal128("-2.30", (short) 2)));
+    assertTrue(r.vector[2].equals(new Decimal128("1.00", (short) 2)));
+
+    // test nulls propagation
+    b = getVectorizedRowBatch3DecimalCols();
+    DecimalColumnVector c0 = (DecimalColumnVector) b.cols[0];
+    c0.noNulls = false;
+    c0.isNull[0] = true;
+    r = (DecimalColumnVector) b.cols[2];
+    expr.evaluate(b);
+    assertTrue(!r.noNulls && r.isNull[0]);
+
+    // Verify null output data entry is not 0, but rather the value specified by design,
+    // which is the minimum non-0 value, 0.01 in this case.
+    assertTrue(r.vector[0].equals(new Decimal128("0.01", (short) 2)));
+
+    // test that overflow produces NULL
+    b = getVectorizedRowBatch3DecimalCols();
+    c0 = (DecimalColumnVector) b.cols[0];
+    c0.vector[0].update("9999999999999999.99", (short) 2); // set to max possible value
+    r = (DecimalColumnVector) b.cols[2];
+    expr.evaluate(b); // will cause overflow for result at position 0, must yield NULL
+    assertTrue(!r.noNulls && r.isNull[0]);
+
+    // verify proper null output data value
+    assertTrue(r.vector[0].equals(new Decimal128("0.01", (short) 2)));
+
+    // test left input repeating
+    b = getVectorizedRowBatch3DecimalCols();
+    c0 = (DecimalColumnVector) b.cols[0];
+    c0.isRepeating = true;
+    r = (DecimalColumnVector) b.cols[2];
+    expr.evaluate(b);
+    assertTrue(r.vector[0].equals(new Decimal128("2.20", (short) 2)));
+    assertTrue(r.vector[1].equals(new Decimal128("2.20", (short) 2)));
+    assertTrue(r.vector[2].equals(new Decimal128("2.20", (short) 2)));
+
+    // test both inputs repeating
+    DecimalColumnVector c1 = (DecimalColumnVector) b.cols[1];
+    c1.isRepeating = true;
+    expr.evaluate(b);
+    assertTrue(r.isRepeating);
+    assertTrue(r.vector[0].equals(new Decimal128("2.20", (short) 2)));
+
+    // test right input repeating
+    b = getVectorizedRowBatch3DecimalCols();
+    c1 = (DecimalColumnVector) b.cols[1];
+    c1.isRepeating = true;
+    c1.vector[0].update("2", (short) 2);
+    r = (DecimalColumnVector) b.cols[2];
+    expr.evaluate(b);
+    assertTrue(r.vector[2].equals(new Decimal128("2", (short) 2)));
+  }
+
+  // Spot check decimal column-column subtract
+  @Test
+  public void testDecimalColumnSubtractDecimalColumn() {
+    VectorizedRowBatch b = getVectorizedRowBatch3DecimalCols();
+    VectorExpression expr = new DecimalColSubtractDecimalColumn(0, 1, 2);
+    DecimalColumnVector r = (DecimalColumnVector) b.cols[2];
+
+    // test without nulls
+    expr.evaluate(b);
+    assertTrue(r.vector[0].equals(new Decimal128("0.20", (short) 2)));
+    assertTrue(r.vector[1].equals(new Decimal128("-4.30", (short) 2)));
+    assertTrue(r.vector[2].equals(new Decimal128("-1.00", (short) 2)));
+
+    // test that underflow produces NULL
+    b = getVectorizedRowBatch3DecimalCols();
+    DecimalColumnVector c0 = (DecimalColumnVector) b.cols[0];
+    c0.vector[0].update("-9999999999999999.99", (short) 2); // set to min possible value
+    r = (DecimalColumnVector) b.cols[2];
+    expr.evaluate(b); // will cause underflow for result at position 0, must yield NULL
+    assertTrue(!r.noNulls && r.isNull[0]);
+  }
+
+  // Spot check decimal column-column multiply
+  @Test
+  public void testDecimalColumnMultiplyDecimalColumn() {
+    VectorizedRowBatch b = getVectorizedRowBatch3DecimalCols();
+    VectorExpression expr = new DecimalColMultiplyDecimalColumn(0, 1, 2);
+    DecimalColumnVector r = (DecimalColumnVector) b.cols[2];
+
+    // test without nulls
+    expr.evaluate(b);
+    assertTrue(r.vector[0].equals(new Decimal128("1.20", (short) 2)));
+    assertTrue(r.vector[1].equals(new Decimal128("-3.30", (short) 2)));
+    assertTrue(r.vector[2].equals(new Decimal128("0.00", (short) 2)));
+
+    // test that underflow produces NULL
+    b = getVectorizedRowBatch3DecimalCols();
+    DecimalColumnVector c0 = (DecimalColumnVector) b.cols[0];
+    c0.vector[0].update("9999999999999999.99", (short) 2); // set to max possible value
+    DecimalColumnVector c1 = (DecimalColumnVector) b.cols[1];
+    c1.vector[0].update("2", (short) 2);
+    r = (DecimalColumnVector) b.cols[2];
+    expr.evaluate(b); // will cause overflow for result at position 0, must yield NULL
+    assertTrue(!r.noNulls && r.isNull[0]);
+  }
+
+  /* Test decimal column to decimal scalar addition. This is used to cover all the
+   * cases used in the source code template ColumnArithmeticScalarDecimal.txt.
+   */
+  @Test
+  public void testDecimalColAddDecimalScalar() {
+    VectorizedRowBatch b = getVectorizedRowBatch3DecimalCols();
+    Decimal128 d = new Decimal128(1);
+    VectorExpression expr = new DecimalColAddDecimalScalar(0, d, 2);
+
+    // test without nulls
+    expr.evaluate(b);
+    DecimalColumnVector r = (DecimalColumnVector) b.cols[2];
+    assertTrue(r.vector[0].equals(new Decimal128("2.20", (short) 2)));
+    assertTrue(r.vector[1].equals(new Decimal128("-2.30", (short) 2)));
+    assertTrue(r.vector[2].equals(new Decimal128("1.00", (short) 2)));
+
+    // test null propagation
+    b = getVectorizedRowBatch3DecimalCols();
+    DecimalColumnVector in = (DecimalColumnVector) b.cols[0];
+    r = (DecimalColumnVector) b.cols[2];
+    in.noNulls = false;
+    in.isNull[0] = true;
+    expr.evaluate(b);
+    assertTrue(!r.noNulls);
+    assertTrue(r.isNull[0]);
+
+    // test repeating case, no nulls
+    b = getVectorizedRowBatch3DecimalCols();
+    in = (DecimalColumnVector) b.cols[0];
+    in.isRepeating = true;
+    expr.evaluate(b);
+    r = (DecimalColumnVector) b.cols[2];
+    assertTrue(r.isRepeating);
+    assertTrue(r.vector[0].equals(new Decimal128("2.20", (short) 2)));
+
+    // test repeating case for null value
+    b = getVectorizedRowBatch3DecimalCols();
+    in = (DecimalColumnVector) b.cols[0];
+    in.isRepeating = true;
+    in.isNull[0] = true;
+    in.noNulls = false;
+    expr.evaluate(b);
+    r = (DecimalColumnVector) b.cols[2];
+    assertTrue(r.isRepeating);
+    assertTrue(!r.noNulls);
+    assertTrue(r.isNull[0]);
+
+    // test that overflow produces null
+    b = getVectorizedRowBatch3DecimalCols();
+    in = (DecimalColumnVector) b.cols[0];
+    in.vector[0].update("9999999999999999.99", (short) 2); // set to max possible value
+    expr.evaluate(b);
+    r = (DecimalColumnVector) b.cols[2];
+    assertFalse(r.noNulls);
+    assertTrue(r.isNull[0]);
+  }
+
+  /* Spot check correctness of decimal column subtract decimal scalar. The case for
+   * addition checks all the cases for the template, so don't do that redundantly here.
+   */
+  @Test
+  public void testDecimalColSubtractDecimalScalar() {
+    VectorizedRowBatch b = getVectorizedRowBatch3DecimalCols();
+    Decimal128 d = new Decimal128(1);
+    VectorExpression expr = new DecimalColSubtractDecimalScalar(0, d, 2);
+
+    // test without nulls
+    expr.evaluate(b);
+    DecimalColumnVector r = (DecimalColumnVector) b.cols[2];
+    assertTrue(r.vector[0].equals(new Decimal128("0.20", (short) 2)));
+    assertTrue(r.vector[1].equals(new Decimal128("-4.30", (short) 2)));
+    assertTrue(r.vector[2].equals(new Decimal128("-1.00", (short) 2)));
+
+    // test that underflow produces null
+    b = getVectorizedRowBatch3DecimalCols();
+    DecimalColumnVector in = (DecimalColumnVector) b.cols[0];
+    in.vector[0].update("-9999999999999999.99", (short) 2); // set to min possible value
+    expr.evaluate(b);
+    r = (DecimalColumnVector) b.cols[2];
+    assertFalse(r.noNulls);
+    assertTrue(r.isNull[0]);
+  }
+
+  /* Spot check correctness of decimal column multiply decimal scalar. The case for
+   * addition checks all the cases for the template, so don't do that redundantly here.
+   */
+  @Test
+  public void testDecimalColMultiplyDecimalScalar() {
+    VectorizedRowBatch b = getVectorizedRowBatch3DecimalCols();
+    Decimal128 d = new Decimal128(2);
+    VectorExpression expr = new DecimalColMultiplyDecimalScalar(0, d, 2);
+
+    // test without nulls
+    expr.evaluate(b);
+    DecimalColumnVector r = (DecimalColumnVector) b.cols[2];
+    assertTrue(r.vector[0].equals(new Decimal128("2.40", (short) 2)));
+    assertTrue(r.vector[1].equals(new Decimal128("-6.60", (short) 2)));
+    assertTrue(r.vector[2].equals(new Decimal128("0", (short) 2)));
+
+    // test that overflow produces null
+    b = getVectorizedRowBatch3DecimalCols();
+    DecimalColumnVector in = (DecimalColumnVector) b.cols[0];
+    in.vector[0].update("9999999999999999.99", (short) 2); // set to max possible value
+    expr.evaluate(b);
+    r = (DecimalColumnVector) b.cols[2];
+    assertFalse(r.noNulls);
+    assertTrue(r.isNull[0]);
+  }
+
+  /* Test decimal scalar to decimal column addition. This is used to cover all the
+   * cases used in the source code template ScalarArithmeticColumnDecimal.txt.
+   */
+  @Test
+  public void testDecimalScalarAddDecimalColumn() {
+    VectorizedRowBatch b = getVectorizedRowBatch3DecimalCols();
+    Decimal128 d = new Decimal128(1);
+    VectorExpression expr = new DecimalScalarAddDecimalColumn(d, 0, 2);
+
+    // test without nulls
+    expr.evaluate(b);
+    DecimalColumnVector r = (DecimalColumnVector) b.cols[2];
+    assertTrue(r.vector[0].equals(new Decimal128("2.20", (short) 2)));
+    assertTrue(r.vector[1].equals(new Decimal128("-2.30", (short) 2)));
+    assertTrue(r.vector[2].equals(new Decimal128("1.00", (short) 2)));
+
+    // test null propagation
+    b = getVectorizedRowBatch3DecimalCols();
+    DecimalColumnVector in = (DecimalColumnVector) b.cols[0];
+    r = (DecimalColumnVector) b.cols[2];
+    in.noNulls = false;
+    in.isNull[0] = true;
+    expr.evaluate(b);
+    assertTrue(!r.noNulls);
+    assertTrue(r.isNull[0]);
+
+    // test repeating case, no nulls
+    b = getVectorizedRowBatch3DecimalCols();
+    in = (DecimalColumnVector) b.cols[0];
+    in.isRepeating = true;
+    expr.evaluate(b);
+    r = (DecimalColumnVector) b.cols[2];
+    assertTrue(r.isRepeating);
+    assertTrue(r.vector[0].equals(new Decimal128("2.20", (short) 2)));
+
+    // test repeating case for null value
+    b = getVectorizedRowBatch3DecimalCols();
+    in = (DecimalColumnVector) b.cols[0];
+    in.isRepeating = true;
+    in.isNull[0] = true;
+    in.noNulls = false;
+    expr.evaluate(b);
+    r = (DecimalColumnVector) b.cols[2];
+    assertTrue(r.isRepeating);
+    assertTrue(!r.noNulls);
+    assertTrue(r.isNull[0]);
+
+    // test that overflow produces null
+    b = getVectorizedRowBatch3DecimalCols();
+    in = (DecimalColumnVector) b.cols[0];
+    in.vector[0].update("9999999999999999.99", (short) 2); // set to max possible value
+    expr.evaluate(b);
+    r = (DecimalColumnVector) b.cols[2];
+    assertFalse(r.noNulls);
+    assertTrue(r.isNull[0]);
+  }
+
+  /* Spot check correctness of decimal scalar subtract decimal column. The case for
+   * addition checks all the cases for the template, so don't do that redundantly here.
+   */
+  @Test
+  public void testDecimalScalarSubtractDecimalColumn() {
+    VectorizedRowBatch b = getVectorizedRowBatch3DecimalCols();
+    Decimal128 d = new Decimal128(1);
+    VectorExpression expr = new DecimalScalarSubtractDecimalColumn(d, 0, 2);
+
+    // test without nulls
+    expr.evaluate(b);
+    DecimalColumnVector r = (DecimalColumnVector) b.cols[2];
+    assertTrue(r.vector[0].equals(new Decimal128("-0.20", (short) 2)));
+    assertTrue(r.vector[1].equals(new Decimal128("4.30", (short) 2)));
+    assertTrue(r.vector[2].equals(new Decimal128("1.00", (short) 2)));
+
+    // test that overflow produces null
+    b = getVectorizedRowBatch3DecimalCols();
+    DecimalColumnVector in = (DecimalColumnVector) b.cols[0];
+    in.vector[0].update("-9999999999999999.99", (short) 2); // set to min possible value
+    expr.evaluate(b);
+    r = (DecimalColumnVector) b.cols[2];
+    assertFalse(r.noNulls);
+    assertTrue(r.isNull[0]);
+  }
+
+  /* Spot check correctness of decimal scalar multiply decimal column. The case for
+   * addition checks all the cases for the template, so don't do that redundantly here.
+   */
+
+  @Test
+  public void testDecimalScalarMultiplyDecimalColumn() {
+    VectorizedRowBatch b = getVectorizedRowBatch3DecimalCols();
+    Decimal128 d = new Decimal128(2);
+    VectorExpression expr = new DecimalScalarMultiplyDecimalColumn(d, 0, 2);
+
+    // test without nulls
+    expr.evaluate(b);
+    DecimalColumnVector r = (DecimalColumnVector) b.cols[2];
+    assertTrue(r.vector[0].equals(new Decimal128("2.40", (short) 2)));
+    assertTrue(r.vector[1].equals(new Decimal128("-6.60", (short) 2)));
+    assertTrue(r.vector[2].equals(new Decimal128("0", (short) 2)));
+
+    // test that overflow produces null
+    b = getVectorizedRowBatch3DecimalCols();
+    DecimalColumnVector in = (DecimalColumnVector) b.cols[0];
+    in.vector[0].update("9999999999999999.99", (short) 2); // set to max possible value
+    expr.evaluate(b);
+    r = (DecimalColumnVector) b.cols[2];
+    assertFalse(r.noNulls);
+    assertTrue(r.isNull[0]);
+  }
+
+  // Make a decimal batch with three columns, including two for inputs and one for the result.
   private VectorizedRowBatch getVectorizedRowBatch3DecimalCols() {
     VectorizedRowBatch b = new VectorizedRowBatch(3);
     DecimalColumnVector v0, v1;

Modified: hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorFilterExpressions.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorFilterExpressions.java?rev=1561947&r1=1561946&r2=1561947&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorFilterExpressions.java (original)
+++ hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorFilterExpressions.java Tue Jan 28 05:48:03 2014
@@ -24,11 +24,16 @@ import static org.junit.Assert.assertTru
 
 import java.sql.Timestamp;
 
+import org.apache.hadoop.hive.common.type.Decimal128;
 import org.apache.hadoop.hive.ql.exec.vector.BytesColumnVector;
+import org.apache.hadoop.hive.ql.exec.vector.DecimalColumnVector;
 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.TimestampUtils;
 import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterDecimalColGreaterEqualDecimalColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterDecimalColLessDecimalScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterDecimalScalarGreaterDecimalColumn;
 import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterDoubleColumnBetween;
 import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterDoubleColumnNotBetween;
 import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterLongColEqualLongScalar;
@@ -41,6 +46,9 @@ import org.apache.hadoop.hive.ql.exec.ve
 import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterLongScalarLessLongColumn;
 import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterStringColumnBetween;
 import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterStringColumnNotBetween;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterDecimalColEqualDecimalScalar;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterDecimalColEqualDecimalColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterDecimalScalarEqualDecimalColumn;
 import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.LongColAddLongScalar;
 import org.apache.hadoop.hive.ql.exec.vector.util.VectorizedRowGroupGenUtil;
 import org.junit.Assert;
@@ -62,31 +70,60 @@ public class TestVectorFilterExpressions
   }
 
   @Test
-  public void testFilterLongColEqualLongColumn() {
+  public void testFilterLongColGreaterLongColumn() {
     int seed = 17;
-    VectorizedRowBatch vrg = VectorizedRowGroupGenUtil.getVectorizedRowBatch(
+    VectorizedRowBatch b = VectorizedRowGroupGenUtil.getVectorizedRowBatch(
         VectorizedRowBatch.DEFAULT_SIZE,
         2, seed);
-    LongColumnVector lcv0 = (LongColumnVector) vrg.cols[0];
-    LongColumnVector lcv1 = (LongColumnVector) vrg.cols[1];
+    LongColumnVector lcv0 = (LongColumnVector) b.cols[0];
+    LongColumnVector lcv1 = (LongColumnVector) b.cols[1];
+    b.size = 3;
     FilterLongColGreaterLongColumn expr = new FilterLongColGreaterLongColumn(0, 1);
 
-    //Basic case
-    lcv0.vector[1] = 23;
-    lcv1.vector[1] = 19;
-    lcv0.vector[5] = 23;
-    lcv1.vector[5] = 19;
-    expr.evaluate(vrg);
-    assertEquals(2, vrg.size);
-    assertEquals(1, vrg.selected[0]);
-    assertEquals(5, vrg.selected[1]);
+    // Basic case
+    lcv0.vector[0] = 10;
+    lcv0.vector[1] = 10;
+    lcv0.vector[2] = 10;
+    lcv1.vector[0] = 20;
+    lcv1.vector[1] = 1;
+    lcv1.vector[2] = 7;
 
-    //handle null
+    expr.evaluate(b);
+    assertEquals(2, b.size);
+    assertEquals(1, b.selected[0]);
+    assertEquals(2, b.selected[1]);
+
+    // handle null with selected in use
     lcv0.noNulls = false;
     lcv0.isNull[1] = true;
-    expr.evaluate(vrg);
-    assertEquals(1, vrg.size);
-    assertEquals(5, vrg.selected[0]);
+    expr.evaluate(b);
+    assertEquals(1, b.size);
+    assertEquals(2, b.selected[0]);
+
+    // handle repeating
+    b.size = 3;
+    b.selectedInUse = false;
+    lcv0.isRepeating = true;
+    lcv0.noNulls = true;
+    expr.evaluate(b);
+    assertEquals(2, b.size);
+
+    // handle repeating null
+    b.size = 3;
+    b.selectedInUse = false;
+    lcv0.isNull[0] = true;
+    lcv0.noNulls = false;
+    expr.evaluate(b);
+    assertEquals(0, b.size);
+
+    // handle null on both sizes (not repeating)
+    b.size = 3;
+    b.selectedInUse = false;
+    lcv0.isRepeating = false;
+    lcv1.noNulls = false;
+    lcv1.isNull[2] = true;
+    expr.evaluate(b);
+    assertEquals(0, b.size);
   }
 
   @Test
@@ -784,4 +821,237 @@ public class TestVectorFilterExpressions
     expr.evaluate(vrb);
     assertEquals(0, vrb.size);
   }
+
+  /**
+   * This tests the template for Decimal Column-Scalar comparison filters,
+   * called FilterDecimalColumnCompareScalar.txt. Only equal is tested for
+   * multiple cases because the logic is the same for <, >, <=, >=, == and !=.
+   */
+  @Test
+  public void testFilterDecimalColEqualDecimalScalar() {
+    VectorizedRowBatch b = getVectorizedRowBatch1DecimalCol();
+    Decimal128 scalar = new Decimal128();
+    scalar.update("-3.30", (short) 2);
+    VectorExpression expr = new FilterDecimalColEqualDecimalScalar(0, scalar);
+    expr.evaluate(b);
+
+    // check that right row(s) are selected
+    assertTrue(b.selectedInUse);
+    assertEquals(1, b.selected[0]);
+    assertEquals(1, b.size);
+
+    // try again with a null value
+    b = getVectorizedRowBatch1DecimalCol();
+    b.cols[0].noNulls = false;
+    b.cols[0].isNull[1] = true;
+    expr.evaluate(b);
+
+    // verify that no rows were selected
+    assertEquals(0, b.size);
+
+    // try the repeating case
+    b = getVectorizedRowBatch1DecimalCol();
+    b.cols[0].isRepeating = true;
+    expr.evaluate(b);
+
+    // verify that no rows were selected
+    assertEquals(0, b.size);
+
+    // try the repeating null case
+    b = getVectorizedRowBatch1DecimalCol();
+    b.cols[0].isRepeating = true;
+    b.cols[0].noNulls = false;
+    b.cols[0].isNull[0] = true;
+    expr.evaluate(b);
+
+    // verify that no rows were selected
+    assertEquals(0, b.size);
+  }
+
+  /**
+   * This tests the template for Decimal Scalar-Column comparison filters,
+   * called FilterDecimalScalarCompareColumn.txt. Only equal is tested for multiple
+   * cases because the logic is the same for <, >, <=, >=, == and !=.
+   */
+  @Test
+  public void testFilterDecimalScalarEqualDecimalColumn() {
+    VectorizedRowBatch b = getVectorizedRowBatch1DecimalCol();
+    Decimal128 scalar = new Decimal128();
+    scalar.update("-3.30", (short) 2);
+    VectorExpression expr = new FilterDecimalScalarEqualDecimalColumn(scalar, 0);
+    expr.evaluate(b);
+
+    // check that right row(s) are selected
+    assertTrue(b.selectedInUse);
+    assertEquals(1, b.selected[0]);
+    assertEquals(1, b.size);
+
+    // try again with a null value
+    b = getVectorizedRowBatch1DecimalCol();
+    b.cols[0].noNulls = false;
+    b.cols[0].isNull[1] = true;
+    expr.evaluate(b);
+
+    // verify that no rows were selected
+    assertEquals(0, b.size);
+
+    // try the repeating case
+    b = getVectorizedRowBatch1DecimalCol();
+    b.cols[0].isRepeating = true;
+    expr.evaluate(b);
+
+    // verify that no rows were selected
+    assertEquals(0, b.size);
+
+    // try the repeating null case
+    b = getVectorizedRowBatch1DecimalCol();
+    b.cols[0].isRepeating = true;
+    b.cols[0].noNulls = false;
+    b.cols[0].isNull[0] = true;
+    expr.evaluate(b);
+
+    // verify that no rows were selected
+    assertEquals(0, b.size);
+  }
+
+  /**
+   * This tests the template for Decimal Column-Column comparison filters,
+   * called FilterDecimalColumnCompareColumn.txt. Only equal is tested for multiple
+   * cases because the logic is the same for <, >, <=, >=, == and !=.
+   */
+  @Test
+  public void testFilterDecimalColumnEqualDecimalColumn() {
+    VectorizedRowBatch b = getVectorizedRowBatch2DecimalCol();
+    VectorExpression expr = new FilterDecimalColEqualDecimalColumn(0, 1);
+    expr.evaluate(b);
+
+    // check that right row(s) are selected
+    assertTrue(b.selectedInUse);
+    assertEquals(1, b.selected[0]);
+    assertEquals(1, b.size);
+
+    // try again with a null value
+    b = getVectorizedRowBatch2DecimalCol();
+    b.cols[0].noNulls = false;
+    b.cols[0].isNull[1] = true;
+    expr.evaluate(b);
+
+    // verify that no rows were selected
+    assertEquals(0, b.size);
+
+    // try the repeating case
+    b = getVectorizedRowBatch2DecimalCol();
+    b.cols[0].isRepeating = true;
+    expr.evaluate(b);
+
+    // verify that no rows were selected
+    assertEquals(0, b.size);
+
+    // try the repeating null case
+    b = getVectorizedRowBatch2DecimalCol();
+    b.cols[0].isRepeating = true;
+    b.cols[0].noNulls = false;
+    b.cols[0].isNull[0] = true;
+    expr.evaluate(b);
+
+    // verify that no rows were selected
+    assertEquals(0, b.size);
+
+    // try nulls on both sides
+    b = getVectorizedRowBatch2DecimalCol();
+    b.cols[0].noNulls = false;
+    b.cols[0].isNull[0] = true;
+    b.cols[1].noNulls = false;
+    b.cols[1].isNull[2] = true;
+    expr.evaluate(b);
+    assertEquals(1, b.size);  // second of three was selected
+
+    // try repeating on both sides
+    b = getVectorizedRowBatch2DecimalCol();
+    b.cols[0].isRepeating = true;
+    b.cols[1].isRepeating = true;
+    expr.evaluate(b);
+
+    // verify that no rows were selected
+    assertEquals(0, b.size);
+  }
+
+  /**
+   * Spot check col < scalar for decimal.
+   */
+  @Test
+  public void testFilterDecimalColLessScalar() {
+    VectorizedRowBatch b = getVectorizedRowBatch1DecimalCol();
+    Decimal128 scalar = new Decimal128();
+    scalar.update("0", (short) 2);
+    VectorExpression expr = new FilterDecimalColLessDecimalScalar(0, scalar);
+    expr.evaluate(b);
+
+    // check that right row(s) are selected
+    assertTrue(b.selectedInUse);
+    assertEquals(1, b.selected[0]);
+    assertEquals(1, b.size);
+  }
+
+  /**
+   * Spot check scalar > col for decimal.
+   */
+  @Test
+  public void testFilterDecimalScalarGreaterThanColumn() {
+    VectorizedRowBatch b = getVectorizedRowBatch1DecimalCol();
+    Decimal128 scalar = new Decimal128();
+    scalar.update("0", (short) 2);
+    VectorExpression expr = new FilterDecimalScalarGreaterDecimalColumn(scalar, 0);
+    expr.evaluate(b);
+
+    // check that right row(s) are selected
+    assertTrue(b.selectedInUse);
+    assertEquals(1, b.selected[0]);
+    assertEquals(1, b.size);
+  }
+
+  /**
+   * Spot check col >= col for decimal.
+   */
+  @Test
+  public void testFilterDecimalColGreaterEqualCol() {
+    VectorizedRowBatch b = getVectorizedRowBatch2DecimalCol();
+    VectorExpression expr = new FilterDecimalColGreaterEqualDecimalColumn(0, 1);
+    expr.evaluate(b);
+
+    // check that right row(s) are selected
+    assertTrue(b.selectedInUse);
+    assertEquals(0, b.selected[0]);
+    assertEquals(1, b.selected[1]);
+    assertEquals(2, b.size);
+  }
+
+  private VectorizedRowBatch getVectorizedRowBatch1DecimalCol() {
+    VectorizedRowBatch b = new VectorizedRowBatch(1);
+    DecimalColumnVector v0;
+    b.cols[0] = v0 = new DecimalColumnVector(18, 2);
+    v0.vector[0].update("1.20", (short) 2);
+    v0.vector[1].update("-3.30", (short) 2);
+    v0.vector[2].update("0", (short) 2);
+
+    b.size = 3;
+    return b;
+  }
+
+  private VectorizedRowBatch getVectorizedRowBatch2DecimalCol() {
+    VectorizedRowBatch b = new VectorizedRowBatch(2);
+    DecimalColumnVector v0, v1;
+    b.cols[0] = v0 = new DecimalColumnVector(18, 2);
+    v0.vector[0].update("1.20", (short) 2);
+    v0.vector[1].update("-3.30", (short) 2);
+    v0.vector[2].update("0", (short) 2);
+
+    b.cols[1] = v1 = new DecimalColumnVector(18, 2);
+    v1.vector[0].update("-1", (short) 2);
+    v1.vector[1].update("-3.30", (short) 2);
+    v1.vector[2].update("10", (short) 2);
+
+    b.size = 3;
+    return b;
+  }
 }

Modified: hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/io/TestHiveBinarySearchRecordReader.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/io/TestHiveBinarySearchRecordReader.java?rev=1561947&r1=1561946&r2=1561947&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/io/TestHiveBinarySearchRecordReader.java (original)
+++ hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/io/TestHiveBinarySearchRecordReader.java Tue Jan 28 05:48:03 2014
@@ -140,7 +140,7 @@ public class TestHiveBinarySearchRecordR
     pt.put("/tmp/testfolder", partDesc);
     MapredWork mrwork = new MapredWork();
     mrwork.getMapWork().setPathToPartitionInfo(pt);
-    Utilities.setMapRedWork(conf, mrwork,"/tmp/" + System.getProperty("user.name") + "/hive");
+    Utilities.setMapRedWork(conf, mrwork,new Path("/tmp/" + System.getProperty("user.name"), "hive"));
 
     hiveSplit = new TestHiveInputSplit();
     hbsReader = new TestHiveRecordReader(rcfReader, conf);

Modified: hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/io/TestSymlinkTextInputFormat.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/io/TestSymlinkTextInputFormat.java?rev=1561947&r1=1561946&r2=1561947&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/io/TestSymlinkTextInputFormat.java (original)
+++ hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/io/TestSymlinkTextInputFormat.java Tue Jan 28 05:48:03 2014
@@ -81,7 +81,7 @@ public class TestSymlinkTextInputFormat 
     pt.put("/tmp/testfolder", partDesc);
     MapredWork mrwork = new MapredWork();
     mrwork.getMapWork().setPathToPartitionInfo(pt);
-    Utilities.setMapRedWork(job, mrwork,"/tmp/" + System.getProperty("user.name") + "/hive");
+    Utilities.setMapRedWork(job, mrwork,new Path("/tmp/" + System.getProperty("user.name"), "hive"));
 
     fileSystem = FileSystem.getLocal(conf);
     testDir = new Path(System.getProperty("test.tmp.dir", System.getProperty(
@@ -169,21 +169,18 @@ public class TestSymlinkTextInputFormat 
       drv.compile(cmd);
 
       //create scratch dir
-      String emptyScratchDirStr;
-      Path emptyScratchDir;
       Context ctx = new Context(newJob);
-      emptyScratchDirStr = ctx.getMRTmpFileURI();
-      emptyScratchDir = new Path(emptyScratchDirStr);
+      Path emptyScratchDir = ctx.getMRTmpPath();
       FileSystem fileSys = emptyScratchDir.getFileSystem(newJob);
       fileSys.mkdirs(emptyScratchDir);
 
       QueryPlan plan = drv.getPlan();
       MapRedTask selectTask = (MapRedTask)plan.getRootTasks().get(0);
 
-      List<Path> inputPaths = Utilities.getInputPaths(newJob, selectTask.getWork().getMapWork(), emptyScratchDir.toString(), ctx);
+      List<Path> inputPaths = Utilities.getInputPaths(newJob, selectTask.getWork().getMapWork(), emptyScratchDir, ctx);
       Utilities.setInputPaths(newJob, inputPaths);
 
-      Utilities.setMapRedWork(newJob, selectTask.getWork(), ctx.getMRTmpFileURI());
+      Utilities.setMapRedWork(newJob, selectTask.getWork(), ctx.getMRTmpPath());
 
       CombineHiveInputFormat combineInputFormat = ReflectionUtils.newInstance(
           CombineHiveInputFormat.class, newJob);

Modified: hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/io/orc/TestOrcFile.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/io/orc/TestOrcFile.java?rev=1561947&r1=1561946&r2=1561947&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/io/orc/TestOrcFile.java (original)
+++ hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/io/orc/TestOrcFile.java Tue Jan 28 05:48:03 2014
@@ -601,6 +601,23 @@ public class TestOrcFile {
     assertEquals(14988, ((StringColumnStatistics)ss1.getColumnStatistics()[2]).getSum());
     assertEquals(15000, ((StringColumnStatistics)ss2.getColumnStatistics()[2]).getSum());
     assertEquals(5012, ((StringColumnStatistics)ss3.getColumnStatistics()[2]).getSum());
+
+    RecordReaderImpl recordReader = (RecordReaderImpl) reader.rows(null);
+    OrcProto.RowIndex[] index = recordReader.readRowIndex(0);
+    assertEquals(3, index.length);
+    List<OrcProto.RowIndexEntry> items = index[1].getEntryList();
+    assertEquals(1, items.size());
+    assertEquals(3, items.get(0).getPositionsCount());
+    assertEquals(0, items.get(0).getPositions(0));
+    assertEquals(0, items.get(0).getPositions(1));
+    assertEquals(0, items.get(0).getPositions(2));
+    assertEquals(1, 
+                 items.get(0).getStatistics().getIntStatistics().getMinimum());
+    index = recordReader.readRowIndex(1);
+    assertEquals(3, index.length);
+    items = index[1].getEntryList();
+    assertEquals(2, 
+                 items.get(0).getStatistics().getIntStatistics().getMaximum());
   }
 
   @Test

Modified: hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/io/orc/TestVectorizedORCReader.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/io/orc/TestVectorizedORCReader.java?rev=1561947&r1=1561946&r2=1561947&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/io/orc/TestVectorizedORCReader.java (original)
+++ hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/io/orc/TestVectorizedORCReader.java Tue Jan 28 05:48:03 2014
@@ -18,24 +18,26 @@
 
 package org.apache.hadoop.hive.ql.io.orc;
 
-import java.io.File;
-import java.sql.Timestamp;
-import java.util.Calendar;
-import java.util.Random;
-
 import junit.framework.Assert;
-
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch;
+import org.apache.hadoop.hive.serde2.io.DateWritable;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory;
 import org.apache.hadoop.io.BooleanWritable;
+import org.apache.hadoop.io.LongWritable;
 import org.apache.hadoop.io.NullWritable;
 import org.junit.Before;
 import org.junit.Test;
 
+import java.io.File;
+import java.sql.Date;
+import java.sql.Timestamp;
+import java.util.Calendar;
+import java.util.Random;
+
 /**
 *
 * Class that tests ORC reader vectorization by comparing records that are
@@ -68,8 +70,10 @@ public class TestVectorizedORCReader {
     private final Double d;
     private final String k;
     private final Timestamp t;
+    private final Date dt;
 
-    MyRecord(Boolean bo, Byte by, Integer i, Long l, Short s, Double d, String k, Timestamp t) {
+    MyRecord(Boolean bo, Byte by, Integer i, Long l, Short s, Double d, String k, Timestamp t,
+             Date dt) {
       this.bo = bo;
       this.by = by;
       this.i = i;
@@ -78,6 +82,7 @@ public class TestVectorizedORCReader {
       this.d = d;
       this.k = k;
       this.t = t;
+      this.dt = dt;
     }
   }
 
@@ -103,12 +108,14 @@ public class TestVectorizedORCReader {
         "before", "us,", "we", "were", "all", "going", "direct", "to",
         "Heaven,", "we", "were", "all", "going", "direct", "the", "other",
         "way"};
+    String[] dates = new String[] {"1991-02-28", "1970-01-31", "1950-04-23"};
     for (int i = 0; i < 21000; ++i) {
       if ((i % 7) != 0) {
         writer.addRow(new MyRecord(((i % 3) == 0), (byte)(i % 5), i, (long) 200, (short) (300 + i), (double) (400 + i),
-            words[r1.nextInt(words.length)], new Timestamp(Calendar.getInstance().getTime().getTime())));
+            words[r1.nextInt(words.length)], new Timestamp(Calendar.getInstance().getTime().getTime()),
+            Date.valueOf(dates[i % 3])));
       } else {
-        writer.addRow(new MyRecord(null, null, i, (long) 200, null, null, null, null));
+        writer.addRow(new MyRecord(null, null, i, (long) 200, null, null, null, null, null));
       }
     }
     writer.close();
@@ -148,6 +155,13 @@ public class TestVectorizedORCReader {
             Assert.assertEquals(true, timeInNanoSec.toString().equals(b.toString()));
             continue;
           }
+
+          // Dates are stored as long, so convert and compare
+          if (a instanceof Date) {
+            Date adt = (Date) a;
+            Assert.assertEquals(adt.getTime(), DateWritable.daysToMillis((int) ((LongWritable) b).get()));
+            continue;
+          }
           if (null == a) {
             Assert.assertEquals(true, (b == null || (b instanceof NullWritable)));
           } else {
@@ -165,6 +179,7 @@ public class TestVectorizedORCReader {
       Assert.assertEquals(false, batch.cols[5].isRepeating);
       Assert.assertEquals(false, batch.cols[6].isRepeating);
       Assert.assertEquals(false, batch.cols[7].isRepeating);
+      Assert.assertEquals(false, batch.cols[8].isRepeating);
 
       // Check non null
       Assert.assertEquals(false, batch.cols[0].noNulls);
@@ -175,6 +190,7 @@ public class TestVectorizedORCReader {
       Assert.assertEquals(false, batch.cols[5].noNulls);
       Assert.assertEquals(false, batch.cols[6].noNulls);
       Assert.assertEquals(false, batch.cols[7].noNulls);
+      Assert.assertEquals(false, batch.cols[8].noNulls);
     }
     Assert.assertEquals(false, rr.hasNext());
   }

Modified: hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHiveMetaStoreChecker.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHiveMetaStoreChecker.java?rev=1561947&r1=1561946&r2=1561947&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHiveMetaStoreChecker.java (original)
+++ hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHiveMetaStoreChecker.java Tue Jan 28 05:48:03 2014
@@ -165,7 +165,7 @@ public class TestHiveMetaStoreChecker ex
     Path fakeTable = table.getPath().getParent().suffix(
         Path.SEPARATOR + "faketable");
     fs.mkdirs(fakeTable);
-    fs.deleteOnExit(fakeTable);    
+    fs.deleteOnExit(fakeTable);
 
     // find the extra table
     result = new CheckResult();
@@ -221,7 +221,7 @@ public class TestHiveMetaStoreChecker ex
     List<Partition> partitions = hive.getPartitions(table);
     assertEquals(2, partitions.size());
     Partition partToRemove = partitions.get(0);
-    Path partToRemovePath = new Path(partToRemove.getDataLocation().toString());
+    Path partToRemovePath = partToRemove.getDataLocation();
     fs = partToRemovePath.getFileSystem(hive.getConf());
     fs.delete(partToRemovePath, true);
 
@@ -298,8 +298,8 @@ public class TestHiveMetaStoreChecker ex
         Path.SEPARATOR + "faketable");
     fs = fakeTable.getFileSystem(hive.getConf());
     fs.mkdirs(fakeTable);
-    fs.deleteOnExit(fakeTable);    
-    
+    fs.deleteOnExit(fakeTable);
+
     Path fakePart = new Path(table.getDataLocation().toString(),
         "fakepartition=fakevalue");
     fs.mkdirs(fakePart);

Modified: hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/optimizer/physical/TestVectorizer.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/optimizer/physical/TestVectorizer.java?rev=1561947&r1=1561946&r2=1561947&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/optimizer/physical/TestVectorizer.java (original)
+++ hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/optimizer/physical/TestVectorizer.java Tue Jan 28 05:48:03 2014
@@ -146,39 +146,63 @@ public class TestVectorizer {
     Assert.assertFalse(v.validateExprNodeDesc(andExprDesc, VectorExpressionDescriptor.Mode.FILTER));
     Assert.assertFalse(v.validateExprNodeDesc(andExprDesc, VectorExpressionDescriptor.Mode.PROJECTION));
   }
+ 
+  /**
+  * prepareAbstractMapJoin prepares a join operator descriptor, used as helper by SMB and Map join tests. 
+  */
+  private void prepareAbstractMapJoin(AbstractMapJoinOperator<? extends MapJoinDesc> mop, MapJoinDesc mjdesc) {
+      mjdesc.setPosBigTable(0);
+      List<ExprNodeDesc> expr = new ArrayList<ExprNodeDesc>();
+      expr.add(new ExprNodeColumnDesc(Integer.class, "col1", "T", false));
+      Map<Byte, List<ExprNodeDesc>> keyMap = new HashMap<Byte, List<ExprNodeDesc>>();
+      keyMap.put((byte)0, expr);
+      mjdesc.setKeys(keyMap);
+      mjdesc.setExprs(keyMap);
 
+      //Set filter expression
+      GenericUDFOPEqual udf = new GenericUDFOPEqual();
+      ExprNodeGenericFuncDesc equalExprDesc = new ExprNodeGenericFuncDesc();
+      equalExprDesc.setTypeInfo(TypeInfoFactory.booleanTypeInfo);
+      equalExprDesc.setGenericUDF(udf);
+      List<ExprNodeDesc> children1 = new ArrayList<ExprNodeDesc>(2);
+      children1.add(new ExprNodeColumnDesc(Integer.class, "col2", "T1", false));
+      children1.add(new ExprNodeColumnDesc(Integer.class, "col3", "T2", false));
+      equalExprDesc.setChildren(children1);
+      List<ExprNodeDesc> filterExpr = new ArrayList<ExprNodeDesc>();
+      filterExpr.add(equalExprDesc);
+      Map<Byte, List<ExprNodeDesc>> filterMap = new HashMap<Byte, List<ExprNodeDesc>>();
+      filterMap.put((byte) 0, expr);
+      mjdesc.setFilters(filterMap);
+ }
+
+  /**
+  * testValidateMapJoinOperator validates that the Map join operator can be vectorized.
+  */
   @Test
   public void testValidateMapJoinOperator() {
     MapJoinOperator mop = new MapJoinOperator();
     MapJoinDesc mjdesc = new MapJoinDesc();
-    mjdesc.setPosBigTable(0);
-    List<ExprNodeDesc> expr = new ArrayList<ExprNodeDesc>();
-    expr.add(new ExprNodeColumnDesc(Integer.class, "col1", "T", false));
-    Map<Byte, List<ExprNodeDesc>> keyMap = new HashMap<Byte, List<ExprNodeDesc>>();
-    keyMap.put((byte)0, expr);
-    mjdesc.setKeys(keyMap);
-    mjdesc.setExprs(keyMap);
-
-    //Set filter expression
-    GenericUDFOPEqual udf = new GenericUDFOPEqual();
-    ExprNodeGenericFuncDesc equalExprDesc = new ExprNodeGenericFuncDesc();
-    equalExprDesc.setTypeInfo(TypeInfoFactory.booleanTypeInfo);
-    equalExprDesc.setGenericUDF(udf);
-    List<ExprNodeDesc> children1 = new ArrayList<ExprNodeDesc>(2);
-    children1.add(new ExprNodeColumnDesc(Integer.class, "col2", "T1", false));
-    children1.add(new ExprNodeColumnDesc(Integer.class, "col3", "T2", false));
-    equalExprDesc.setChildren(children1);
-    List<ExprNodeDesc> filterExpr = new ArrayList<ExprNodeDesc>();
-    filterExpr.add(equalExprDesc);
-    Map<Byte, List<ExprNodeDesc>> filterMap = new HashMap<Byte, List<ExprNodeDesc>>();
-    filterMap.put((byte) 0, expr);
-    mjdesc.setFilters(filterMap);
+    
+    prepareAbstractMapJoin(mop, mjdesc);
     mop.setConf(mjdesc);
-
+ 
     Vectorizer vectorizer = new Vectorizer();
-
     Assert.assertTrue(vectorizer.validateOperator(mop));
-    SMBMapJoinOperator smbmop = new SMBMapJoinOperator(mop);
-    Assert.assertFalse(vectorizer.validateOperator(smbmop));
+  }
+
+  
+  /**
+  * testValidateSMBJoinOperator validates that the SMB join operator can be vectorized.
+  */
+  @Test
+  public void testValidateSMBJoinOperator() {
+      SMBMapJoinOperator mop = new SMBMapJoinOperator();
+      SMBJoinDesc mjdesc = new SMBJoinDesc();
+      
+      prepareAbstractMapJoin(mop, mjdesc);
+      mop.setConf(mjdesc);
+    
+      Vectorizer vectorizer = new Vectorizer();
+      Assert.assertTrue(vectorizer.validateOperator(mop)); 
   }
 }

Modified: hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/plan/TestConditionalResolverCommonJoin.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/plan/TestConditionalResolverCommonJoin.java?rev=1561947&r1=1561946&r2=1561947&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/plan/TestConditionalResolverCommonJoin.java (original)
+++ hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/plan/TestConditionalResolverCommonJoin.java Tue Jan 28 05:48:03 2014
@@ -18,18 +18,60 @@
 
 package org.apache.hadoop.hive.ql.plan;
 
-import junit.framework.TestCase;
-
-import org.apache.hadoop.hive.ql.plan.ConditionalResolverCommonJoin.AliasFileSizePair;
-
-public class TestConditionalResolverCommonJoin extends TestCase {
-
-    public void testAliasFileSizePairCompareTo() {
-        AliasFileSizePair big = new AliasFileSizePair("big", 389560034778L);
-        AliasFileSizePair small = new AliasFileSizePair("small", 1647L);
-
-        assertEquals(0, big.compareTo(big));
-        assertEquals(1, big.compareTo(small));
-        assertEquals(-1, small.compareTo(big));
-    }
-}
+import junit.framework.Assert;
+import org.apache.hadoop.hive.conf.HiveConf;
+import org.apache.hadoop.hive.ql.exec.Task;
+import org.junit.Test;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+
+public class TestConditionalResolverCommonJoin {
+
+  @Test
+  public void testResolvingDriverAlias() throws Exception {
+    ConditionalResolverCommonJoin resolver = new ConditionalResolverCommonJoin();
+
+    HashMap<String, ArrayList<String>> pathToAliases = new HashMap<String, ArrayList<String>>();
+    pathToAliases.put("path1", new ArrayList<String>(Arrays.asList("alias1", "alias2")));
+    pathToAliases.put("path2", new ArrayList<String>(Arrays.asList("alias3")));
+
+    HashMap<String, Long> aliasToKnownSize = new HashMap<String, Long>();
+    aliasToKnownSize.put("alias1", 1024l);
+    aliasToKnownSize.put("alias2", 2048l);
+    aliasToKnownSize.put("alias3", 4096l);
+
+    // joins alias1, alias2, alias3 (alias1 was not eligible for big pos)
+    HashMap<String, Task<? extends Serializable>> aliasToTask =
+        new HashMap<String, Task<? extends Serializable>>();
+    aliasToTask.put("alias2", null);
+    aliasToTask.put("alias3", null);
+
+    ConditionalResolverCommonJoin.ConditionalResolverCommonJoinCtx ctx =
+        new ConditionalResolverCommonJoin.ConditionalResolverCommonJoinCtx();
+    ctx.setPathToAliases(pathToAliases);
+    ctx.setAliasToTask(aliasToTask);
+    ctx.setAliasToKnownSize(aliasToKnownSize);
+
+    HiveConf conf = new HiveConf();
+    conf.setLongVar(HiveConf.ConfVars.HIVESMALLTABLESFILESIZE, 4096);
+
+    // alias3 only can be selected
+    String resolved = resolver.resolveMapJoinTask(ctx, conf);
+    Assert.assertEquals("alias3", resolved);
+
+    conf.setLongVar(HiveConf.ConfVars.HIVESMALLTABLESFILESIZE, 65536);
+
+    // alias1, alias2, alias3 all can be selected but overriden by biggest one (alias3)
+    resolved = resolver.resolveMapJoinTask(ctx, conf);
+    Assert.assertEquals("alias3", resolved);
+
+    conf.setLongVar(HiveConf.ConfVars.HIVESMALLTABLESFILESIZE, 2048);
+
+    // not selected
+    resolved = resolver.resolveMapJoinTask(ctx, conf);
+    Assert.assertNull(resolved);
+  }
+}
\ No newline at end of file

Modified: hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFLTrim.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFLTrim.java?rev=1561947&r1=1561946&r2=1561947&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFLTrim.java (original)
+++ hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFLTrim.java Tue Jan 28 05:48:03 2014
@@ -15,7 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.hadoop.hive.ql.udf;
+package org.apache.hadoop.hive.ql.udf.generic;
 
 import org.apache.hadoop.hive.ql.metadata.HiveException;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDF;

Modified: hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFLpad.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFLpad.java?rev=1561947&r1=1561946&r2=1561947&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFLpad.java (original)
+++ hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFLpad.java Tue Jan 28 05:48:03 2014
@@ -15,7 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.hadoop.hive.ql.udf;
+package org.apache.hadoop.hive.ql.udf.generic;
 
 import org.apache.hadoop.hive.ql.metadata.HiveException;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDF;

Modified: hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFRTrim.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFRTrim.java?rev=1561947&r1=1561946&r2=1561947&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFRTrim.java (original)
+++ hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFRTrim.java Tue Jan 28 05:48:03 2014
@@ -15,7 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.hadoop.hive.ql.udf;
+package org.apache.hadoop.hive.ql.udf.generic;
 
 import org.apache.hadoop.hive.ql.metadata.HiveException;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDF;

Modified: hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFRpad.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFRpad.java?rev=1561947&r1=1561946&r2=1561947&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFRpad.java (original)
+++ hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFRpad.java Tue Jan 28 05:48:03 2014
@@ -15,7 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.hadoop.hive.ql.udf;
+package org.apache.hadoop.hive.ql.udf.generic;
 
 import org.apache.hadoop.hive.ql.metadata.HiveException;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDF;

Modified: hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFTrim.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFTrim.java?rev=1561947&r1=1561946&r2=1561947&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFTrim.java (original)
+++ hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFTrim.java Tue Jan 28 05:48:03 2014
@@ -15,7 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.hadoop.hive.ql.udf;
+package org.apache.hadoop.hive.ql.udf.generic;
 
 import org.apache.hadoop.hive.ql.metadata.HiveException;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDF;

Modified: hive/branches/tez/ql/src/test/queries/clientpositive/metadata_only_queries.q
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/queries/clientpositive/metadata_only_queries.q?rev=1561947&r1=1561946&r2=1561947&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/queries/clientpositive/metadata_only_queries.q (original)
+++ hive/branches/tez/ql/src/test/queries/clientpositive/metadata_only_queries.q Tue Jan 28 05:48:03 2014
@@ -9,7 +9,7 @@ create table over10k(
            d double,
            bo boolean,
            s string,
-	   ts timestamp, 
+           ts timestamp, 
            dec decimal,  
            bin binary)
        row format delimited
@@ -51,9 +51,9 @@ insert into table stats_tbl_part partiti
 insert into table stats_tbl_part partition (dt='2012') select * from over10k where t>60;
 
 explain 
-select count(*), count(1), count(s), count(bo), count(bin), count(si), max(i), min(b) from stats_tbl;
+select count(*), sum(1), sum(0.2), count(1), count(s), count(bo), count(bin), count(si), max(i), min(b) from stats_tbl;
 explain
-select count(*), count(1), count(s), count(bo), count(bin), count(si), max(i), min(b) from stats_tbl_part;
+select count(*), sum(1), sum(0.2), count(1), count(s), count(bo), count(bin), count(si), max(i), min(b) from stats_tbl_part;
 
 analyze table stats_tbl compute statistics for columns t,si,i,b,f,d,bo,s,bin;
 analyze table stats_tbl_part partition(dt='2010') compute statistics for columns t,si,i,b,f,d,bo,s,bin;
@@ -61,11 +61,11 @@ analyze table stats_tbl_part partition(d
 analyze table stats_tbl_part partition(dt='2012') compute statistics for columns t,si,i,b,f,d,bo,s,bin;
 
 explain 
-select count(*), count(1), count(s), count(bo), count(bin), count(si), max(i), min(b), max(f), min(d) from stats_tbl;
-select count(*), count(1), count(s), count(bo), count(bin), count(si), max(i), min(b), max(f), min(d) from stats_tbl;
+select count(*), sum(1), sum(0.2), count(1), count(s), count(bo), count(bin), count(si), max(i), min(b), max(f), min(d) from stats_tbl;
+select count(*), sum(1), sum(0.2), count(1), count(s), count(bo), count(bin), count(si), max(i), min(b), max(f), min(d) from stats_tbl;
 explain 
-select count(*), count(1), count(s), count(bo), count(bin), count(si), max(i), min(b), max(f), min(d) from stats_tbl_part;
-select count(*), count(1), count(s), count(bo), count(bin), count(si), max(i), min(b), max(f), min(d) from stats_tbl_part;
+select count(*), sum(1), sum(0.2), count(1), count(s), count(bo), count(bin), count(si), max(i), min(b), max(f), min(d) from stats_tbl_part;
+select count(*), sum(1), sum(0.2), count(1), count(s), count(bo), count(bin), count(si), max(i), min(b), max(f), min(d) from stats_tbl_part;
 
 explain select count(ts) from stats_tbl_part;
 

Modified: hive/branches/tez/ql/src/test/queries/clientpositive/partition_date.q
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/queries/clientpositive/partition_date.q?rev=1561947&r1=1561946&r2=1561947&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/queries/clientpositive/partition_date.q (original)
+++ hive/branches/tez/ql/src/test/queries/clientpositive/partition_date.q Tue Jan 28 05:48:03 2014
@@ -1,45 +1,58 @@
 drop table partition_date_1;
 
-create table partition_date_1 (key string, value string) partitioned by (dt date, region int);
+create table partition_date_1 (key string, value string) partitioned by (dt date, region string);
 
-insert overwrite table partition_date_1 partition(dt='2000-01-01', region=1)
+insert overwrite table partition_date_1 partition(dt='2000-01-01', region= '1')
   select * from src tablesample (10 rows);
-insert overwrite table partition_date_1 partition(dt='2000-01-01', region=2)
+insert overwrite table partition_date_1 partition(dt='2000-01-01', region= '2')
   select * from src tablesample (5 rows);
-insert overwrite table partition_date_1 partition(dt='2013-08-08', region=1) 
+insert overwrite table partition_date_1 partition(dt='2013-12-10', region= '2020-20-20')
+  select * from src tablesample (5 rows);
+insert overwrite table partition_date_1 partition(dt='2013-08-08', region= '1') 
   select * from src tablesample (20 rows);
-insert overwrite table partition_date_1 partition(dt='2013-08-08', region=10) 
+insert overwrite table partition_date_1 partition(dt='2013-08-08', region= '10') 
   select * from src tablesample (11 rows);
 
+
 select distinct dt from partition_date_1;
-select * from partition_date_1 where dt = '2000-01-01' and region = 2 order by key,value;
+select * from partition_date_1 where dt = '2000-01-01' and region = '2' order by key,value;
 
 -- 15
 select count(*) from partition_date_1 where dt = date '2000-01-01';
 -- 15.  Also try with string value in predicate
 select count(*) from partition_date_1 where dt = '2000-01-01';
 -- 5
-select count(*) from partition_date_1 where dt = date '2000-01-01' and region = 2;
+select count(*) from partition_date_1 where dt = date '2000-01-01' and region = '2';
 -- 11
-select count(*) from partition_date_1 where dt = date '2013-08-08' and region = 10;
+select count(*) from partition_date_1 where dt = date '2013-08-08' and region = '10';
 -- 30
-select count(*) from partition_date_1 where region = 1;
+select count(*) from partition_date_1 where region = '1';
 -- 0
-select count(*) from partition_date_1 where dt = date '2000-01-01' and region = 3;
+select count(*) from partition_date_1 where dt = date '2000-01-01' and region = '3';
 -- 0
 select count(*) from partition_date_1 where dt = date '1999-01-01';
 
 -- Try other comparison operations
 
 -- 20
-select count(*) from partition_date_1 where dt > date '2000-01-01' and region = 1;
+select count(*) from partition_date_1 where dt > date '2000-01-01' and region = '1';
 -- 10
-select count(*) from partition_date_1 where dt < date '2000-01-02' and region = 1;
+select count(*) from partition_date_1 where dt < date '2000-01-02' and region = '1';
 -- 20
-select count(*) from partition_date_1 where dt >= date '2000-01-02' and region = 1;
+select count(*) from partition_date_1 where dt >= date '2000-01-02' and region = '1';
 -- 10
-select count(*) from partition_date_1 where dt <= date '2000-01-01' and region = 1;
+select count(*) from partition_date_1 where dt <= date '2000-01-01' and region = '1';
 -- 20
-select count(*) from partition_date_1 where dt <> date '2000-01-01' and region = 1;
+select count(*) from partition_date_1 where dt <> date '2000-01-01' and region = '1';
+-- 10
+select count(*) from partition_date_1 where dt between date '1999-12-30' and date '2000-01-03' and region = '1';
+
+
+-- Try a string key with date-like strings
+
+-- 5
+select count(*) from partition_date_1 where region = '2020-20-20';
+-- 5
+select count(*) from partition_date_1 where region > '2010-01-01';
 
 drop table partition_date_1;

Modified: hive/branches/tez/ql/src/test/results/clientnegative/addpart1.q.out
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/results/clientnegative/addpart1.q.out?rev=1561947&r1=1561946&r2=1561947&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/results/clientnegative/addpart1.q.out (original)
+++ hive/branches/tez/ql/src/test/results/clientnegative/addpart1.q.out Tue Jan 28 05:48:03 2014
@@ -18,4 +18,4 @@ b=f/c=s
 PREHOOK: query: alter table addpart1 add partition (b='f', c='')
 PREHOOK: type: ALTERTABLE_ADDPARTS
 PREHOOK: Input: default@addpart1
-FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. get partition: Value for key c is null or empty
+FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. partition spec is invalid; field c does not exist or is empty

Modified: hive/branches/tez/ql/src/test/results/clientnegative/alter_partition_coltype_2columns.q.out
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/results/clientnegative/alter_partition_coltype_2columns.q.out?rev=1561947&r1=1561946&r2=1561947&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/results/clientnegative/alter_partition_coltype_2columns.q.out (original)
+++ hive/branches/tez/ql/src/test/results/clientnegative/alter_partition_coltype_2columns.q.out Tue Jan 28 05:48:03 2014
@@ -33,4 +33,4 @@ ts                  	string             
 	 	 
 dt                  	string              	None                
 ts                  	string              	None                
-FAILED: ParseException line 4:50 mismatched input ',' expecting ) near 'int' in alter table partition statement
+FAILED: ParseException line 4:50 mismatched input ',' expecting ) near 'int' in alter partition key type

Modified: hive/branches/tez/ql/src/test/results/clientnegative/alter_table_add_partition.q.out
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/results/clientnegative/alter_table_add_partition.q.out?rev=1561947&r1=1561946&r2=1561947&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/results/clientnegative/alter_table_add_partition.q.out (original)
+++ hive/branches/tez/ql/src/test/results/clientnegative/alter_table_add_partition.q.out Tue Jan 28 05:48:03 2014
@@ -3,4 +3,4 @@ PREHOOK: type: CREATETABLE
 POSTHOOK: query: create table mp (a int) partitioned by (b int)
 POSTHOOK: type: CREATETABLE
 POSTHOOK: Output: default@mp
-FAILED: SemanticException [Error 10098]: Non-Partition column appears in the partition specification:  c
+FAILED: SemanticException Partition spec {b=1, c=1} contains non-partition columns

Modified: hive/branches/tez/ql/src/test/results/clientnegative/alter_view_failure4.q.out
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/results/clientnegative/alter_view_failure4.q.out?rev=1561947&r1=1561946&r2=1561947&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/results/clientnegative/alter_view_failure4.q.out (original)
+++ hive/branches/tez/ql/src/test/results/clientnegative/alter_view_failure4.q.out Tue Jan 28 05:48:03 2014
@@ -13,9 +13,4 @@ AS 
 SELECT * FROM src
 POSTHOOK: type: CREATEVIEW
 POSTHOOK: Output: default@xxx5
-PREHOOK: query: -- should fail:  LOCATION clause is illegal
-#### A masked pattern was here ####
-PREHOOK: type: ALTERTABLE_ADDPARTS
-PREHOOK: Input: default@src
-PREHOOK: Input: default@xxx5
-FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. LOCATION clause illegal for view partition
+FAILED: SemanticException LOCATION clause illegal for view partition

Modified: hive/branches/tez/ql/src/test/results/clientnegative/alter_view_failure5.q.out
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/results/clientnegative/alter_view_failure5.q.out?rev=1561947&r1=1561946&r2=1561947&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/results/clientnegative/alter_view_failure5.q.out (original)
+++ hive/branches/tez/ql/src/test/results/clientnegative/alter_view_failure5.q.out Tue Jan 28 05:48:03 2014
@@ -13,4 +13,4 @@ AS 
 SELECT * FROM src
 POSTHOOK: type: CREATEVIEW
 POSTHOOK: Output: default@xxx6
-FAILED: SemanticException [Error 10098]: Non-Partition column appears in the partition specification:  v
+FAILED: SemanticException Partition spec {v=val_86} contains non-partition columns

Modified: hive/branches/tez/ql/src/test/results/clientnegative/alter_view_failure7.q.out
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/results/clientnegative/alter_view_failure7.q.out?rev=1561947&r1=1561946&r2=1561947&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/results/clientnegative/alter_view_failure7.q.out (original)
+++ hive/branches/tez/ql/src/test/results/clientnegative/alter_view_failure7.q.out Tue Jan 28 05:48:03 2014
@@ -13,4 +13,4 @@ AS 
 SELECT key,ds,hr FROM srcpart
 POSTHOOK: type: CREATEVIEW
 POSTHOOK: Output: default@xxx8
-FAILED: SemanticException [Error 10214]: Invalid partition spec specified table is partitioned but partition spec is not specified or does not fully match table partitioning: {ds=2011-01-01}
+FAILED: SemanticException partition spec {ds=2011-01-01} doesn't contain all (2) partition columns

Modified: hive/branches/tez/ql/src/test/results/clientnegative/analyze1.q.out
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/results/clientnegative/analyze1.q.out?rev=1561947&r1=1561946&r2=1561947&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/results/clientnegative/analyze1.q.out (original)
+++ hive/branches/tez/ql/src/test/results/clientnegative/analyze1.q.out Tue Jan 28 05:48:03 2014
@@ -1 +1 @@
-FAILED: SemanticException [Error 10098]: Non-Partition column appears in the partition specification:  key
+FAILED: SemanticException Partition spec {key=null} contains non-partition columns

Modified: hive/branches/tez/ql/src/test/results/clientnegative/dyn_part1.q.out
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/results/clientnegative/dyn_part1.q.out?rev=1561947&r1=1561946&r2=1561947&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/results/clientnegative/dyn_part1.q.out (original)
+++ hive/branches/tez/ql/src/test/results/clientnegative/dyn_part1.q.out Tue Jan 28 05:48:03 2014
@@ -3,4 +3,4 @@ PREHOOK: type: CREATETABLE
 POSTHOOK: query: create table dynamic_partition (key string) partitioned by (value string)
 POSTHOOK: type: CREATETABLE
 POSTHOOK: Output: default@dynamic_partition
-FAILED: SemanticException [Error 10098]: Non-Partition column appears in the partition specification:  hr
+FAILED: SemanticException Partition spec {hr=null} contains non-partition columns

Modified: hive/branches/tez/ql/src/test/results/clientnegative/truncate_partition_column.q.out
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/results/clientnegative/truncate_partition_column.q.out?rev=1561947&r1=1561946&r2=1561947&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/results/clientnegative/truncate_partition_column.q.out (original)
+++ hive/branches/tez/ql/src/test/results/clientnegative/truncate_partition_column.q.out Tue Jan 28 05:48:03 2014
@@ -17,4 +17,4 @@ POSTHOOK: Input: default@src
 POSTHOOK: Output: default@test_tab@part=1
 POSTHOOK: Lineage: test_tab PARTITION(part=1).key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default), ]
 POSTHOOK: Lineage: test_tab PARTITION(part=1).value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ]
-FAILED: SemanticException org.apache.hadoop.hive.ql.metadata.HiveException: table is partitioned but partition spec is not specified or does not fully match table partitioning: null
+FAILED: SemanticException org.apache.hadoop.hive.ql.parse.SemanticException: table is partitioned but partition spec is not specified

Modified: hive/branches/tez/ql/src/test/results/clientpositive/add_part_exist.q.out
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/results/clientpositive/add_part_exist.q.out?rev=1561947&r1=1561946&r2=1561947&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/results/clientpositive/add_part_exist.q.out (original)
+++ hive/branches/tez/ql/src/test/results/clientpositive/add_part_exist.q.out Tue Jan 28 05:48:03 2014
@@ -22,11 +22,9 @@ ds=2010-01-01
 PREHOOK: query: ALTER TABLE add_part_test ADD IF NOT EXISTS PARTITION (ds='2010-01-01')
 PREHOOK: type: ALTERTABLE_ADDPARTS
 PREHOOK: Input: default@add_part_test
-PREHOOK: Output: default@add_part_test@ds=2010-01-01
 POSTHOOK: query: ALTER TABLE add_part_test ADD IF NOT EXISTS PARTITION (ds='2010-01-01')
 POSTHOOK: type: ALTERTABLE_ADDPARTS
 POSTHOOK: Input: default@add_part_test
-POSTHOOK: Output: default@add_part_test@ds=2010-01-01
 PREHOOK: query: SHOW PARTITIONS add_part_test
 PREHOOK: type: SHOWPARTITIONS
 POSTHOOK: query: SHOW PARTITIONS add_part_test
@@ -48,13 +46,9 @@ ds=2010-01-02
 PREHOOK: query: ALTER TABLE add_part_test ADD IF NOT EXISTS PARTITION (ds='2010-01-01') PARTITION (ds='2010-01-02') PARTITION (ds='2010-01-03')
 PREHOOK: type: ALTERTABLE_ADDPARTS
 PREHOOK: Input: default@add_part_test
-PREHOOK: Output: default@add_part_test@ds=2010-01-01
-PREHOOK: Output: default@add_part_test@ds=2010-01-02
 POSTHOOK: query: ALTER TABLE add_part_test ADD IF NOT EXISTS PARTITION (ds='2010-01-01') PARTITION (ds='2010-01-02') PARTITION (ds='2010-01-03')
 POSTHOOK: type: ALTERTABLE_ADDPARTS
 POSTHOOK: Input: default@add_part_test
-POSTHOOK: Output: default@add_part_test@ds=2010-01-01
-POSTHOOK: Output: default@add_part_test@ds=2010-01-02
 POSTHOOK: Output: default@add_part_test@ds=2010-01-03
 PREHOOK: query: SHOW PARTITIONS add_part_test
 PREHOOK: type: SHOWPARTITIONS
@@ -122,11 +116,9 @@ ds=2010-01-01
 PREHOOK: query: ALTER TABLE add_part_test ADD IF NOT EXISTS PARTITION (ds='2010-01-01')
 PREHOOK: type: ALTERTABLE_ADDPARTS
 PREHOOK: Input: add_part_test_db@add_part_test
-PREHOOK: Output: add_part_test_db@add_part_test@ds=2010-01-01
 POSTHOOK: query: ALTER TABLE add_part_test ADD IF NOT EXISTS PARTITION (ds='2010-01-01')
 POSTHOOK: type: ALTERTABLE_ADDPARTS
 POSTHOOK: Input: add_part_test_db@add_part_test
-POSTHOOK: Output: add_part_test_db@add_part_test@ds=2010-01-01
 PREHOOK: query: SHOW PARTITIONS add_part_test
 PREHOOK: type: SHOWPARTITIONS
 POSTHOOK: query: SHOW PARTITIONS add_part_test
@@ -148,13 +140,9 @@ ds=2010-01-02
 PREHOOK: query: ALTER TABLE add_part_test ADD IF NOT EXISTS PARTITION (ds='2010-01-01') PARTITION (ds='2010-01-02') PARTITION (ds='2010-01-03')
 PREHOOK: type: ALTERTABLE_ADDPARTS
 PREHOOK: Input: add_part_test_db@add_part_test
-PREHOOK: Output: add_part_test_db@add_part_test@ds=2010-01-01
-PREHOOK: Output: add_part_test_db@add_part_test@ds=2010-01-02
 POSTHOOK: query: ALTER TABLE add_part_test ADD IF NOT EXISTS PARTITION (ds='2010-01-01') PARTITION (ds='2010-01-02') PARTITION (ds='2010-01-03')
 POSTHOOK: type: ALTERTABLE_ADDPARTS
 POSTHOOK: Input: add_part_test_db@add_part_test
-POSTHOOK: Output: add_part_test_db@add_part_test@ds=2010-01-01
-POSTHOOK: Output: add_part_test_db@add_part_test@ds=2010-01-02
 POSTHOOK: Output: add_part_test_db@add_part_test@ds=2010-01-03
 PREHOOK: query: SHOW PARTITIONS add_part_test
 PREHOOK: type: SHOWPARTITIONS

Modified: hive/branches/tez/ql/src/test/results/clientpositive/add_part_multiple.q.out
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/results/clientpositive/add_part_multiple.q.out?rev=1561947&r1=1561946&r2=1561947&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/results/clientpositive/add_part_multiple.q.out (original)
+++ hive/branches/tez/ql/src/test/results/clientpositive/add_part_multiple.q.out Tue Jan 28 05:48:03 2014
@@ -26,29 +26,12 @@ ABSTRACT SYNTAX TREE:
 
 STAGE DEPENDENCIES:
   Stage-0 is a root stage
-  Stage-1 is a root stage
-  Stage-2 is a root stage
-  Stage-3 is a root stage
 
 STAGE PLANS:
   Stage: Stage-0
       Add Partition Operator:
 #### A masked pattern was here ####
-          Spec: {ds=2010-01-01}
-
-  Stage: Stage-1
-      Add Partition Operator:
-#### A masked pattern was here ####
-          Spec: {ds=2010-02-01}
-
-  Stage: Stage-2
-      Add Partition Operator:
-          Spec: {ds=2010-03-01}
-
-  Stage: Stage-3
-      Add Partition Operator:
-#### A masked pattern was here ####
-          Spec: {ds=2010-04-01}
+          Spec: {ds=2010-01-01}, {ds=2010-02-01}, {ds=2010-03-01}, {ds=2010-04-01}
 
 PREHOOK: query: ALTER TABLE add_part_test ADD IF NOT EXISTS
 PARTITION (ds='2010-01-01') location 'A'

Modified: hive/branches/tez/ql/src/test/results/clientpositive/alter_partition_coltype.q.out
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/results/clientpositive/alter_partition_coltype.q.out?rev=1561947&r1=1561946&r2=1561947&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/results/clientpositive/alter_partition_coltype.q.out (original)
+++ hive/branches/tez/ql/src/test/results/clientpositive/alter_partition_coltype.q.out Tue Jan 28 05:48:03 2014
@@ -50,11 +50,11 @@ POSTHOOK: Lineage: alter_coltype PARTITI
 25
 PREHOOK: query: -- alter partition key column data type for dt column.
 alter table alter_coltype partition column (dt int)
-PREHOOK: type: null
+PREHOOK: type: ALTERTABLE_PARTCOLTYPE
 PREHOOK: Input: default@alter_coltype
 POSTHOOK: query: -- alter partition key column data type for dt column.
 alter table alter_coltype partition column (dt int)
-POSTHOOK: type: null
+POSTHOOK: type: ALTERTABLE_PARTCOLTYPE
 POSTHOOK: Input: default@alter_coltype
 POSTHOOK: Output: default@alter_coltype
 POSTHOOK: Lineage: alter_coltype PARTITION(dt=100x,ts=6:30pm).key SIMPLE [(src1)src1.FieldSchema(name:key, type:string, comment:default), ]
@@ -240,11 +240,11 @@ POSTHOOK: Lineage: alter_coltype PARTITI
 0
 PREHOOK: query: -- alter partition key column data type for ts column.
 alter table alter_coltype partition column (ts double)
-PREHOOK: type: null
+PREHOOK: type: ALTERTABLE_PARTCOLTYPE
 PREHOOK: Input: default@alter_coltype
 POSTHOOK: query: -- alter partition key column data type for ts column.
 alter table alter_coltype partition column (ts double)
-POSTHOOK: type: null
+POSTHOOK: type: ALTERTABLE_PARTCOLTYPE
 POSTHOOK: Input: default@alter_coltype
 POSTHOOK: Output: default@alter_coltype
 POSTHOOK: Lineage: alter_coltype PARTITION(dt=10,ts=3.0).key SIMPLE [(src1)src1.FieldSchema(name:key, type:string, comment:default), ]
@@ -252,10 +252,10 @@ POSTHOOK: Lineage: alter_coltype PARTITI
 POSTHOOK: Lineage: alter_coltype PARTITION(dt=100x,ts=6:30pm).key SIMPLE [(src1)src1.FieldSchema(name:key, type:string, comment:default), ]
 POSTHOOK: Lineage: alter_coltype PARTITION(dt=100x,ts=6:30pm).value SIMPLE [(src1)src1.FieldSchema(name:value, type:string, comment:default), ]
 PREHOOK: query: alter table alter_coltype partition column (dt string)
-PREHOOK: type: null
+PREHOOK: type: ALTERTABLE_PARTCOLTYPE
 PREHOOK: Input: default@alter_coltype
 POSTHOOK: query: alter table alter_coltype partition column (dt string)
-POSTHOOK: type: null
+POSTHOOK: type: ALTERTABLE_PARTCOLTYPE
 POSTHOOK: Input: default@alter_coltype
 POSTHOOK: Output: default@alter_coltype
 POSTHOOK: Lineage: alter_coltype PARTITION(dt=10,ts=3.0).key SIMPLE [(src1)src1.FieldSchema(name:key, type:string, comment:default), ]

Modified: hive/branches/tez/ql/src/test/results/clientpositive/auto_join25.q.out
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/results/clientpositive/auto_join25.q.out?rev=1561947&r1=1561946&r2=1561947&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/results/clientpositive/auto_join25.q.out (original)
+++ hive/branches/tez/ql/src/test/results/clientpositive/auto_join25.q.out Tue Jan 28 05:48:03 2014
@@ -69,7 +69,7 @@ Obtaining error information
 
 Task failed!
 Task ID:
-  Stage-14
+  Stage-15
 
 Logs:
 
@@ -129,7 +129,7 @@ Obtaining error information
 
 Task failed!
 Task ID:
-  Stage-7
+  Stage-8
 
 Logs:
 

Modified: hive/branches/tez/ql/src/test/results/clientpositive/create_view_partitioned.q.out
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/results/clientpositive/create_view_partitioned.q.out?rev=1561947&r1=1561946&r2=1561947&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/results/clientpositive/create_view_partitioned.q.out (original)
+++ hive/branches/tez/ql/src/test/results/clientpositive/create_view_partitioned.q.out Tue Jan 28 05:48:03 2014
@@ -133,14 +133,14 @@ PREHOOK: query: -- should work since we 
 ALTER VIEW vp1
 ADD IF NOT EXISTS PARTITION (value='val_xyz')
 PREHOOK: type: ALTERTABLE_ADDPARTS
+PREHOOK: Input: default@src
 PREHOOK: Input: default@vp1
-PREHOOK: Output: default@vp1@value=val_xyz
 POSTHOOK: query: -- should work since we use IF NOT EXISTS
 ALTER VIEW vp1
 ADD IF NOT EXISTS PARTITION (value='val_xyz')
 POSTHOOK: type: ALTERTABLE_ADDPARTS
+POSTHOOK: Input: default@src
 POSTHOOK: Input: default@vp1
-POSTHOOK: Output: default@vp1@value=val_xyz
 PREHOOK: query: SHOW PARTITIONS vp1
 PREHOOK: type: SHOWPARTITIONS
 POSTHOOK: query: SHOW PARTITIONS vp1

Modified: hive/branches/tez/ql/src/test/results/clientpositive/infer_bucket_sort_convert_join.q.out
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/results/clientpositive/infer_bucket_sort_convert_join.q.out?rev=1561947&r1=1561946&r2=1561947&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/results/clientpositive/infer_bucket_sort_convert_join.q.out (original)
+++ hive/branches/tez/ql/src/test/results/clientpositive/infer_bucket_sort_convert_join.q.out Tue Jan 28 05:48:03 2014
@@ -79,7 +79,7 @@ Obtaining error information
 
 Task failed!
 Task ID:
-  Stage-7
+  Stage-8
 
 Logs:
 

Modified: hive/branches/tez/ql/src/test/results/clientpositive/mapjoin_hook.q.out
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/results/clientpositive/mapjoin_hook.q.out?rev=1561947&r1=1561946&r2=1561947&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/results/clientpositive/mapjoin_hook.q.out (original)
+++ hive/branches/tez/ql/src/test/results/clientpositive/mapjoin_hook.q.out Tue Jan 28 05:48:03 2014
@@ -49,7 +49,7 @@ Obtaining error information
 
 Task failed!
 Task ID:
-  Stage-14
+  Stage-15
 
 Logs: