public static Timestamp decimalToTimestamp(HiveDecimalV1 dec) {
    try {
      BigDecimal nanoInstant = dec.bigDecimalValue().multiply(BILLION_BIG_DECIMAL);
      int nanos = nanoInstant.remainder(BILLION_BIG_DECIMAL).intValue();
      if (nanos < 0) {
        nanos += 1000000000;
      }
      long seconds =
          nanoInstant.subtract(new BigDecimal(nanos)).divide(BILLION_BIG_DECIMAL).longValue();

      return Timestamp.ofEpochSecond(seconds, nanos);
    } catch (IllegalArgumentException | DateTimeException nfe) {
      return null;
    }
  }
Take a HiveDecimalWritable and return the timestamp representation where the fraction part
is the nanoseconds and integer part is the number of seconds.

This is a HiveDecimalWritable variation with supplied scratch objects.
@param decWritable
@param scratchDecWritable1
@param scratchDecWritable2
@return
common/src/java/org/apache/hadoop/hive/common/type/TimestampUtils.java