private VectorizedRowBatch getBatchTimestampDecimal(HiveDecimal[] hiveDecimalValues) {
    Random r = new Random(994);
    VectorizedRowBatch b = new VectorizedRowBatch(2);
    TimestampColumnVector tcv;
    b.cols[0] = tcv = new TimestampColumnVector(hiveDecimalValues.length);
    b.cols[1] = new DecimalColumnVector(hiveDecimalValues.length, HiveDecimal.SYSTEM_DEFAULT_PRECISION, HiveDecimal.SYSTEM_DEFAULT_SCALE);
    for (int i = 0; i < hiveDecimalValues.length; i++) {
      int optionalNanos = 0;
      switch (r.nextInt(4)) {
      case 0:
        // No nanos.
        break;
      case 1:
        optionalNanos = r.nextInt((int) NANOSECONDS_PER_SECOND);
        break;
      case 2:
        // Limit to milliseconds only...
        optionalNanos = r.nextInt((int) MILLISECONDS_PER_SECOND) * (int) NANOSECONDS_PER_MILLISSECOND;
        break;
      case 3:
        // Limit to below milliseconds only...
        optionalNanos = r.nextInt((int) NANOSECONDS_PER_MILLISSECOND);
        break;
      }
      long millis = RandomTypeUtil.randomMillis(r);
      Timestamp ts = new Timestamp(millis);
      ts.setNanos(optionalNanos);
      TimestampWritableV2 tsw = new TimestampWritableV2(
          org.apache.hadoop.hive.common.type.Timestamp.ofEpochMilli(ts.getTime(), ts.getNanos()));
      hiveDecimalValues[i] = tsw.getHiveDecimal();

      tcv.set(i, ts);
    }
    b.size = hiveDecimalValues.length;
    return b;
  }
Just spot check the basic case because code path is the same as
for cast of decimal to long due to inheritance.
ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorTypeCasts.java