@Test
  public void testCastDateToTimestamp() throws HiveException {
    int[] intValues = new int[500];
    VectorizedRowBatch b = TestVectorMathFunctions.getVectorizedRowBatchDateInTimestampOut(intValues);
    TimestampColumnVector resultV = (TimestampColumnVector) b.cols[1];
    b.cols[0].noNulls = true;
    VectorExpression expr = new CastDateToTimestamp(0, 1);
    expr.evaluate(b);
    for (int i = 0; i < intValues.length; i++) {
      Timestamp timestamp = resultV.asScratchTimestamp(i);
      long actual = DateWritableV2.millisToDays(timestamp.getTime());
      assertEquals(actual, intValues[i]);
    }
  }
Test VectorExpression classes for vectorized implementations of type casts.
ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorTypeCasts.java