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