@Test
  public void testCastTimestampToDouble() throws HiveException {
    double[] doubleValues = new double[500];
    VectorizedRowBatch b = TestVectorMathFunctions.getVectorizedRowBatchTimestampInDoubleOut(doubleValues);
    TimestampColumnVector inV = (TimestampColumnVector) b.cols[0];
    DoubleColumnVector resultV = (DoubleColumnVector) b.cols[1];
    b.cols[0].noNulls = true;
    VectorExpression expr = new CastTimestampToDouble(0, 1);
    expr.evaluate(b);
    for (int i = 0; i < doubleValues.length; i++) {
      double actual = resultV.vector[i];
      double doubleValue = TimestampUtils.getDouble(inV.asScratchTimestamp(i));
      assertEquals(actual, doubleValue, 0.000000001F);
    }
  }
Test VectorExpression classes for vectorized implementations of type casts.
ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorTypeCasts.java