Gets the field type.

@param schema the schema
@param field the field
@return the field type
@throws IOException Signals that an I/O exception has occurred.
186773
private String getFieldType(IndexSchema schema, String field)
      throws IOException {
    SchemaField sf = schema.getField(field);
    FieldType ft = sf.getType();
    if (ft != null) {
      if (ft.isPointField() && !sf.hasDocValues()) {
        return ComponentFacet.TYPE_POINTFIELD_WITHOUT_DOCVALUES;
      }
      NumberType nt = ft.getNumberType();
      if (nt != null) {
        return nt.name();
      } else {
        return ComponentFacet.TYPE_STRING;
      }
    } else {
      // best guess
      return ComponentFacet.TYPE_STRING;
    }
  }
646518
public static String getMapFieldValueType(Field field) {
        FieldType type = field.getType();
        if (!(type instanceof Message)) {
            throw new IllegalArgumentException(field.toString());
        }
        Message entryType = (Message) type;
        Type valueType = entryType.getField(MAP_ENTRY_VALUE).getType();
        String v;
        if (valueType instanceof ScalarFieldType) {
            ScalarFieldType scalarValueType = (ScalarFieldType) valueType;
            v = ScalarFieldTypeUtil.getWrapperType(scalarValueType);
        } else {
            UserType userType = (UserType) valueType;
            v = UserTypeUtil.getCanonicalName(userType);
        }
        return v;
    }
1034129
public static Optional<Class> resolveGenericTypeArgument(Field field) {
        Type genericType = field != null ? field.getGenericType() : null;
        if (genericType instanceof ParameterizedType) {
            Type[] typeArguments = ((ParameterizedType) genericType).getActualTypeArguments();
            if (typeArguments.length > 0) {
                Type typeArg = typeArguments[0];
                return resolveParameterizedTypeArgument(typeArg);
            }
        }
        return Optional.empty();
    }
403647
private CustomFieldDefinition getCustomFieldDefinitionType(JsonNode jn) throws IOException {
		if (jn.isArray()) {
			JsonNode jn1 = jn.get(0);
			String type = jn1.get(TYPE).textValue();
			try {
				return (CustomFieldDefinition) Class.forName("com.intuit.ipp.data." + type + "CustomFieldDefinition").newInstance();
			} catch (Exception e) {
				throw new IOException("Exception while deserializing CustomFieldDefinition", e);
			}
		}
		
		return null;
	}
778921
def get_field_type_from_schema(schema_type, field_name):
    """"""
    if field_name == '@class':
        return GraphQLString
    else:
        if field_name not in schema_type.fields:
            raise AssertionError(u'Field {} passed validation but was not present on type '
                                 u'{}'.format(field_name, schema_type))

        # Validation guarantees that the field must exist in the schema.
        return schema_type.fields[field_name].type
871967
public static <A extends Annotation> A getAnnotation(Field field, Class<A> annotationType) {
        if (field == null || annotationType == null) {
            return null;
        }

        return field.getAnnotation(annotationType);
    }
463646
public static List<FieldMetadata> getFieldMetadata(Schema schema) {
    List<Field> superclassFields = Arrays.asList(Weaver.getWovenFields(schema.getClass().getSuperclass()));

    List<FieldMetadata> fields = new ArrayList<>();
    // Fields up to but not including Schema
    for (Field field : Weaver.getWovenFields(schema.getClass())) {
      FieldMetadata fmd = FieldMetadata.createIfApiAnnotation(schema, field, superclassFields);
      if (null != fmd) // skip transient or other non-annotated fields
        fields.add(fmd);  // NOTE: we include non-JSON fields here; remove them later if we don't want them
    }
    return fields;
  }
1123469
public HCatInputFormatBase<T> getFields(String... fields) throws IOException {

		// build output schema
		ArrayList<HCatFieldSchema> fieldSchemas = new ArrayList<HCatFieldSchema>(fields.length);
		for (String field : fields) {
			fieldSchemas.add(this.outputSchema.get(field));
		}
		this.outputSchema = new HCatSchema(fieldSchemas);

		// update output schema configuration
		configuration.set("mapreduce.lib.hcat.output.schema", HCatUtil.serialize(outputSchema));

		return this;
	}
880458
public Schema mapper(String field, Mapper mapper) {
        if (mappers == null) {
            mappers = new LinkedHashMap<>();
        }
        mappers.put(field, mapper);
        return this;
    }
556841
public static String getRepeatedFieldType(Field field) {
        FieldType type = field.getType();
        if (type instanceof ScalarFieldType) {
            ScalarFieldType scalarFieldType = (ScalarFieldType) type;
            return LIST + "<" + ScalarFieldTypeUtil.getWrapperType(scalarFieldType) + ">";
        }
        if (type instanceof UserType) {
            UserType userType = (UserType) type;
            return LIST + "<" + UserTypeUtil.getCanonicalName(userType) + ">";
        }
        throw new IllegalArgumentException(field.toString());
    }
723420
public static <E> Schema getWriterSchema(Class<E> type, Schema schema) {
    Schema writerSchema = schema;
    GenericData dataModel = getDataModelForType(type);
    if (dataModel instanceof AllowNulls) {
      // assume fields are non-null by default to avoid schema conflicts
      dataModel = ReflectData.get();
    }

    if (dataModel instanceof SpecificData) {
      writerSchema = ((SpecificData)dataModel).getSchema(type);
    }

    return writerSchema;
  }
1247742
public AccrueType getAccrueType(int field)
   {
      AccrueType result;

      if ((field < m_fields.length) && (m_fields[field].length() != 0))
      {
         result = AccrueTypeUtility.getInstance(m_fields[field], m_locale);
      }
      else
      {
         result = null;
      }

      return (result);
   }
328930
def get_field_def(
    schema,  # type: GraphQLSchema
    parent_type,  # type: Union[GraphQLInterfaceType, GraphQLObjectType]
    field_ast,  # type: Field
):
    # type: (...) -> Optional[GraphQLField]
    """"""
    name = field_ast.name.value
    if name == "__schema" and schema.get_query_type() == parent_type:
        return SchemaMetaFieldDef

    elif name == "__type" and schema.get_query_type() == parent_type:
        return TypeMetaFieldDef

    elif name == "__typename" and isinstance(
        parent_type, (GraphQLObjectType, GraphQLInterfaceType, GraphQLUnionType)
    ):
        return TypeNameMetaFieldDef

    elif isinstance(parent_type, (GraphQLObjectType, GraphQLInterfaceType)):
        return parent_type.fields.get(name)
115935
public static Type forField(Field field) {
		Assert.notNull(field, "Field must not be null");
		return forTypeProvider(new FieldTypeProvider(field));
	}
683854
def getSolrType(self, field):
        
        ftype = 'string'
        try:
            ftype = self.fieldtypes[field]
            return ftype
        except Exception:
            pass
        fta = field.split('_')
        if len(fta) > 1:
            ft = fta[len(fta) - 1]
            try:
                ftype = self.fieldtypes[ft]
                # cache the type so it's used next time
                self.fieldtypes[field] = ftype
            except Exception:
                pass
        return ftype
626647
public static JavaType of(final Class<?> implementClass, final Field field) {
		return of(new ImplementClass(implementClass), field);
	}
1162715
private void writeField(FieldType field, Object value) throws IOException
   {
      String fieldName = field.name().toLowerCase();
      writeField(fieldName, field.getDataType(), value);
   }