private void generateJsonFromValue(Object value, int fieldIndex, JsonGenerator jsonGen)
      throws JsonProcessingException, IOException {
    String label = columnNames.get(fieldIndex);
    PrimitiveObjectInspector poi = (PrimitiveObjectInspector) this.columnOIs.get(fieldIndex);
    if (value == null) {
      jsonGen.writeObjectField(label, null);
    } else if (value instanceof LazyPrimitive<?, ?>) {  // have seen LazyString, #25
      generateJsonFromLazy((LazyPrimitive<?, ?>) value, fieldIndex, label, poi, jsonGen);
    } else if (value instanceof Writable) {
      generateJsonFromWritable((Writable) value, fieldIndex, label, poi, jsonGen);
    } else {  // SparkSQL, #97
      jsonGen.writeObjectField(label, value);
    }
  }
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