private java.sql.Timestamp parseTime(JsonParser parser) throws IOException {
    java.sql.Timestamp jst = null;
    if (JsonToken.VALUE_NUMBER_INT.equals(parser.getCurrentToken())) {
      long epoch = parser.getLongValue();
      jst = new java.sql.Timestamp(epoch);
    } else {
      String value = parser.getText();
      int point = value.indexOf('.');
      String dateStr = (point < 0) ? value : value.substring(0, point + 4);
      String[] formats = { "yyyy-MM-dd HH:mm:ss.SSS", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM-dd" };
      for (String format : formats) {
        try {
          jst = new java.sql.Timestamp(parseTime(dateStr, format));
          break;
        } catch (java.text.ParseException e) {
          // remain null after this attempted format
        }
      }
    }  // else String value
    return jst;
  }
Send to the generator, the value of the cell, using column type

@param value The attribute value as the object given by Hive
@param fieldIndex column index of field in row
@param jsonGen JsonGenerator
@throws JsonProcessingException
@throws IOException
ql/src/java/org/apache/hadoop/hive/ql/udf/esri/serde/BaseJsonSerDe.java