code: public static Optional<Field> getField(Schema schema, String fieldLocation) {
      Preconditions.checkNotNull(schema);
      Preconditions.checkArgument(!Strings.isNullOrEmpty(fieldLocation));
  
      Splitter splitter = Splitter.on(FIELD_LOCATION_DELIMITER).omitEmptyStrings().trimResults();
      List<String> pathList = Lists.newArrayList(splitter.split(fieldLocation));
  
      if (pathList.size() == 0) {
        return Optional.absent();
      }
  
      return AvroUtils.getFieldHelper(schema, pathList, 0);
    }
docs: Given a GenericRecord, this method will return the field specified by the path parameter. The
  fieldLocation parameter is an ordered string specifying the location of the nested field to retrieve. For example,
  field1.nestedField1 takes field "field1", and retrieves "nestedField1" from it.
  @param schema is the record to retrieve the schema from
  @param fieldLocation is the location of the field
  @return the field