@Override
  public String toString() {
    if (timestampEmpty) {
      populateTimestamp();
    }

    if (timestamp.getNanos() > 0) {
      return timestamp.toString();
    }

    String timestampString = timestamp.toString();
    if (timestampString.length() > 19) {
      if (timestampString.length() == 21) {
        if (timestampString.substring(19).compareTo(".0") == 0) {
          return timestamp.format(DATE_TIME_FORMAT);
        }
      }
      return timestamp.format(DATE_TIME_FORMAT) + timestampString.substring(19);
    }

    return timestamp.format(DATE_TIME_FORMAT);
  }
@return double representation of the timestamp, accurate to microseconds
serde/src/java/org/apache/hadoop/hive/serde2/io/TimestampWritableV2.java