@VisibleForTesting static TypeInfo convert(Schema schema) { return SchemaUtil.visit(schema, new Converter()); }
@VisibleForTesting static TypeInfo convert(Schema schema) { return SchemaUtil.visit(schema, new Converter()); }
/** * Returns a list of field names from the schema that contain characters that * are known to be incompatible with some projects, such as Hive or HBase. * * @param schema a {@link org.apache.avro.Schema} to check * @return a {@link java.util.List} of incompatible field names */ private static List<String> getIncompatibleNames(Schema schema) { NameValidation validation = new NameValidation(); SchemaUtil.visit(schema, validation); return validation.getIncompatibleNames(); }
for (Schema.Field field : schema.getFields()) { names.add(field.name()); results.add(visit(field.schema(), visitor)); List<T> options = Lists.newArrayListWithExpectedSize(types.size()); for (Schema type : types) { options.add(visit(type, visitor)); return visitor.array(schema, visit(schema.getElementType(), visitor)); return visitor.map(schema, visit(schema.getValueType(), visitor));