@Test public void test() { PAssert .that(buildBasePipeline(pipeline).apply(RecordBranchMapper.of(null, "b1", "other"))) .satisfies(values -> { final List<Record> items = StreamSupport.stream(values.spliterator(), false).collect(toList()); assertEquals(2, items.size()); items.forEach(item -> { final Collection<Record> other = item.getArray(Record.class, "other"); assertNotNull(other); assertNotNull(other.iterator().next().getString("foo")); assertNull(item.get(Object.class, "b1")); assertNotNull(item.get(Object.class, "b2")); }); return null; }); assertEquals(PipelineResult.State.DONE, pipeline.run().waitUntilFinish()); }
public static PTransform<PCollection<Record>, PCollection<Record>> of(final String plugin, final String branchSelector) { return new RecordParDoTransformCoderProvider<>(SchemaRegistryCoder.of(), new RecordBranchUnwrapper(branchSelector)); }
RecordBranchUnwrapper extends DoFn<Record, Record> { public static PTransform<PCollection<Record>, PCollection<Record>> of(final String plugin, final String branchSelector) { return new RecordParDoTransformCoderProvider<>(SchemaRegistryCoder.of(), new RecordBranchUnwrapper(branchSelector)); } }
RecordBranchUnwrapper extends DoFn<Record, Record> { public static PTransform<PCollection<Record>, PCollection<Record>> of(final String plugin, final String branchSelector) { return new RecordParDoTransformCoderProvider<>(SchemaRegistryCoder.of(), new RecordBranchUnwrapper(branchSelector)); } RecordBranchUnwrapper(final String branch); protected  RecordBranchUnwrapper(); }
RecordBranchUnwrapper extends DoFn<Record, Record> { public static PTransform<PCollection<Record>, PCollection<Record>> of(final String plugin, final String branchSelector) { return new RecordParDoTransformCoderProvider<>(SchemaRegistryCoder.of(), new RecordBranchUnwrapper(branchSelector)); } RecordBranchUnwrapper(final String branch); protected  RecordBranchUnwrapper(); @ProcessElement void onElement(final ProcessContext context); static PTransform<PCollection<Record>, PCollection<Record>> of(final String plugin,
            final String branchSelector); }
RecordBranchUnwrapper extends DoFn<Record, Record> { public static PTransform<PCollection<Record>, PCollection<Record>> of(final String plugin, final String branchSelector) { return new RecordParDoTransformCoderProvider<>(SchemaRegistryCoder.of(), new RecordBranchUnwrapper(branchSelector)); } RecordBranchUnwrapper(final String branch); protected  RecordBranchUnwrapper(); @ProcessElement void onElement(final ProcessContext context); static PTransform<PCollection<Record>, PCollection<Record>> of(final String plugin,
            final String branchSelector);  }