code: @Override
      public ResourceSchema getSchema(String location, Job job) throws IOException {
          ResourceSchema rs = new ResourceSchema();
          List<ResourceFieldSchema> fieldSchemaList = new ArrayList<>();
  
          for (String fieldName : requestedFields) {
              ResourceFieldSchema rfs = new ResourceFieldSchema();
              rfs.setName(fieldName);
              rfs.setDescription(fieldName);
  
              if(fieldName.endsWith(".*")) {
                  rfs.setType(DataType.MAP);
              } else {
                  EnumSet<Casts> casts = theInputFormat.getRecordReader().getCasts(fieldName);
                  if (casts != null) {
                      if (casts.contains(Casts.LONG)) {
                          rfs.setType(DataType.LONG);
                      } else {
                          if (casts.contains(Casts.DOUBLE)) {
                              rfs.setType(DataType.DOUBLE);
                          } else {
                              rfs.setType(DataType.CHARARRAY);
                          }
                      }
                  } else {
                      rfs.setType(DataType.BYTEARRAY);
                  }
              }
              fieldSchemaList.add(rfs);
          }
  
          rs.setFields(fieldSchemaList.toArray(new ResourceFieldSchema[fieldSchemaList.size()]));
          return rs;
      }
docs: ------------------------------------------