@Test public void testGeneric() throws IOException { String genericSchemaJson = Person.SCHEMA$.toString().replace("Person", "GenericPerson"); Schema genericPersonSchema = new Schema.Parser() .parse(genericSchemaJson); GenericRecord savedRecord = new GenericData.Record(genericPersonSchema); savedRecord.put("name", "John Doe"); savedRecord.put("age", 42); savedRecord.put("siblingnames", Lists.newArrayList("Jimmy", "Jane")); populateGenericFile(Lists.newArrayList(savedRecord), genericPersonSchema); Pipeline pipeline = new MRPipeline(AvroFileSourceTargetTest.class); PCollection<Record> genericCollection = pipeline .read(At.avroFile(avroFile.getAbsolutePath(), Avros.generics(genericPersonSchema))); List<Record> recordList = Lists.newArrayList(genericCollection .materialize()); assertEquals(Lists.newArrayList(savedRecord), Lists.newArrayList(recordList)); }
@Override public String toString() { return target.toString(); }
AvroFileSourceTarget extends ReadableSourcePathTargetImpl<T> { @Override public String toString() { return target.toString(); } }
AvroFileSourceTarget extends ReadableSourcePathTargetImpl<T> { @Override public String toString() { return target.toString(); } AvroFileSourceTarget(Path path, AvroType<T> atype); }
AvroFileSourceTarget extends ReadableSourcePathTargetImpl<T> { @Override public String toString() { return target.toString(); } AvroFileSourceTarget(Path path, AvroType<T> atype); @Override String toString(); }
AvroFileSourceTarget extends ReadableSourcePathTargetImpl<T> { @Override public String toString() { return target.toString(); } AvroFileSourceTarget(Path path, AvroType<T> atype); @Override String toString();  }