public DataType getResultingDataType() {
        if (isEmpty()) {
            return null;
        }

        return get(size() - 1).getResultingDataType();
    }
@return Returns the datatype we can expect this field path to return.
document/src/main/java/com/yahoo/document/FieldPath.java