code: private static Optional<Schema> getFieldSchemaHelper(Schema schema, List<String> pathList, int field) {
      if (schema.getType() == Type.RECORD && schema.getField(pathList.get(field)) == null) {
        return Optional.absent();
      }
      switch (schema.getType()) {
        case UNION:
          if (AvroSerdeUtils.isNullableType(schema)) {
            return AvroUtils.getFieldSchemaHelper(AvroSerdeUtils.getOtherTypeFromNullableType(schema), pathList, field);
          }
          throw new AvroRuntimeException("Union of complex types cannot be handled : " + schema);
        case MAP:
          if ((field + 1) == pathList.size()) {
            return Optional.fromNullable(schema.getValueType());
          }
          return AvroUtils.getFieldSchemaHelper(schema.getValueType(), pathList, ++field);
        case RECORD:
          if ((field + 1) == pathList.size()) {
            return Optional.fromNullable(schema.getField(pathList.get(field)).schema());
          }
          return AvroUtils.getFieldSchemaHelper(schema.getField(pathList.get(field)).schema(), pathList, ++field);
        default:
          throw new AvroRuntimeException("Invalid type in schema : " + schema);
      }
    }
docs: Helper method that does the actual work for {@link #getFieldSchema(Schema, String)}
  @param schema passed from {@link #getFieldSchema(Schema, String)}
  @param pathList passed from {@link #getFieldSchema(Schema, String)}
  @param field keeps track of the index used to access the list pathList
  @return the schema of the field