@Test
  public void testCastDoubleToTimestamp() throws HiveException {
    VectorizedRowBatch b = TestVectorMathFunctions.getVectorizedRowBatchDoubleInTimestampOut();
    TimestampColumnVector resultV = (TimestampColumnVector) b.cols[1];
    b.cols[0].noNulls = true;
    VectorExpression expr = new CastDoubleToTimestamp(0, 1);
    expr.evaluate(b);
    Assert.assertEquals(0.0, TimestampUtils.getDouble(resultV.asScratchTimestamp(3)), Double.MIN_VALUE);
    Assert.assertEquals(0.5d, TimestampUtils.getDouble(resultV.asScratchTimestamp(4)), Double.MIN_VALUE);
  }
Test VectorExpression classes for vectorized implementations of type casts.
ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorTypeCasts.java