in mr/src/main/java/org/elasticsearch/hadoop/serialization/builder/JdkValueReader.java [54:103]
public Object readValue(Parser parser, String value, FieldType esType) {
if (esType == null) {
return nullValue();
}
switch (esType) {
case NULL:
return nullValue();
case STRING:
case TEXT:
case KEYWORD:
return textValue(value);
case BYTE:
return byteValue(value, parser);
case SHORT:
return shortValue(value, parser);
case INTEGER:
return intValue(value, parser);
case TOKEN_COUNT:
case LONG:
return longValue(value, parser);
case HALF_FLOAT:
case FLOAT:
return floatValue(value, parser);
case SCALED_FLOAT:
case DOUBLE:
return doubleValue(value, parser);
case BOOLEAN:
return booleanValue(value, parser);
case BINARY:
byte[] binValue = parser.binaryValue();
if(binValue == null) binValue = value.getBytes();
return binaryValue(binValue);
case DATE:
return date(value, parser);
case DATE_NANOS:
return dateNanos(value, parser);
case JOIN:
// In the case of a join field reaching this point it is because it is the short-hand form for a parent.
// construct a container and place the short form name into the name subfield.
Object container = createMap();
addToMap(container, "name", textValue(value));
return container;
// catch-all - exists really for the other custom types that might be introduced
// compound types should have been handled earlier in the stream
default:
return textValue(value);
}
}