Search in sources :

Example 6 with PCollectionList

use of org.apache.beam.sdk.values.PCollectionList in project beam by apache.

the class PTransformMatchersTest method flattenWithDuplicateInputsWithDuplicates.

@Test
public void flattenWithDuplicateInputsWithDuplicates() {
    PCollection<Object> duplicate = PCollection.createPrimitiveOutputInternal(p, WindowingStrategy.globalDefault(), IsBounded.BOUNDED);
    AppliedPTransform application = AppliedPTransform.<PCollectionList<Object>, PCollection<Object>, Flatten.PCollections<Object>>of("Flatten", ImmutableMap.<TupleTag<?>, PValue>builder().put(new TupleTag<Object>(), duplicate).put(new TupleTag<Object>(), duplicate).build(), Collections.<TupleTag<?>, PValue>singletonMap(new TupleTag<Object>(), PCollection.createPrimitiveOutputInternal(p, WindowingStrategy.globalDefault(), IsBounded.BOUNDED)), Flatten.pCollections(), p);
    assertThat(PTransformMatchers.flattenWithDuplicateInputs().matches(application), is(true));
}
Also used : PCollectionList(org.apache.beam.sdk.values.PCollectionList) PCollection(org.apache.beam.sdk.values.PCollection) AppliedPTransform(org.apache.beam.sdk.runners.AppliedPTransform) TupleTag(org.apache.beam.sdk.values.TupleTag) PValue(org.apache.beam.sdk.values.PValue) Test(org.junit.Test)

Aggregations

PCollection (org.apache.beam.sdk.values.PCollection)6 PCollectionList (org.apache.beam.sdk.values.PCollectionList)6 Test (org.junit.Test)6 AppliedPTransform (org.apache.beam.sdk.runners.AppliedPTransform)4 TupleTag (org.apache.beam.sdk.values.TupleTag)4 FlattenWithoutDuplicateInputs (org.apache.beam.runners.core.construction.DeduplicatedFlattenFactory.FlattenWithoutDuplicateInputs)1 Defaults (org.apache.beam.sdk.Pipeline.PipelineVisitor.Defaults)1 TransformHierarchy (org.apache.beam.sdk.runners.TransformHierarchy)1 Node (org.apache.beam.sdk.runners.TransformHierarchy.Node)1 Flatten (org.apache.beam.sdk.transforms.Flatten)1 PValue (org.apache.beam.sdk.values.PValue)1