Sets { public static <T> PTransform<PCollection<T>, PCollection<T>> unionAll( PCollection<T> rightCollection) { checkNotNull(rightCollection, "rightCollection argument is null"); return new SetImpl<>(rightCollection, unionAll()); }  static PTransform<PCollection<T>, PCollection<T>> intersectDistinct(
      PCollection<T> rightCollection); static PTransform<PCollectionList<T>, PCollection<T>> intersectDistinct(); static PTransform<PCollection<T>, PCollection<T>> intersectAll(
      PCollection<T> rightCollection); static PTransform<PCollectionList<T>, PCollection<T>> intersectAll(); static PTransform<PCollection<T>, PCollection<T>> exceptDistinct(
      PCollection<T> rightCollection); static PTransform<PCollectionList<T>, PCollection<T>> exceptDistinct(); static PTransform<PCollection<T>, PCollection<T>> exceptAll(
      PCollection<T> rightCollection); static PTransform<PCollectionList<T>, PCollection<T>> exceptAll(); static PTransform<PCollection<T>, PCollection<T>> unionDistinct(
      PCollection<T> rightCollection); static PTransform<PCollectionList<T>, PCollection<T>> unionDistinct(); static PTransform<PCollection<T>, PCollection<T>> unionAll(
      PCollection<T> rightCollection); static Flatten.PCollections<T> unionAll();  }
@Test @Category(NeedsRunner.class) public void testUnionAll() { PAssert.that(first.apply("strings", Sets.unionAll(second))) .containsInAnyOrder( "a", "a", "a", "a", "a", "b", "b", "b", "b", "b", "c", "c", "d", "d", "d", "d", "e", "e", "f", "f", "g", "g", "h", "h"); PCollection<Row> results = firstRows.apply("rows", Sets.unionAll(secondRows)); PAssert.that(results) .containsInAnyOrder( toRows( "a", "a", "a", "a", "a", "b", "b", "b", "b", "b", "c", "c", "d", "d", "d", "d", "e", "e", "f", "f", "g", "g", "h", "h")); assertEquals(schema, results.getSchema()); p.run(); }
@Test @Category(NeedsRunner.class) public void testUnionAllCollections() { PCollection<String> third = p.apply("third", Create.of(Arrays.asList("a", "b", "b", "k", "k"))); PCollection<Row> thirdRows = p.apply("thirdRows", Create.of(toRows("a", "b", "b", "k", "k"))); PAssert.that( PCollectionList.of(first).and(second).and(third).apply("stringsCols", Sets.unionAll())) .containsInAnyOrder( "a", "a", "a", "a", "a", "a", "b", "b", "b", "b", "b", "b", "b", "c", "c", "d", "d", "d", "d", "e", "e", "f", "f", "g", "g", "h", "h", "k", "k"); PCollection<Row> results = PCollectionList.of(firstRows) .and(secondRows) .and(thirdRows) .apply("rowCols", Sets.unionAll()); PAssert.that(results) .containsInAnyOrder( toRows( "a", "a", "a", "a", "a", "a", "b", "b", "b", "b", "b", "b", "b", "c", "c", "d", "d", "d", "d", "e", "e", "f", "f", "g", "g", "h", "h", "k", "k")); assertEquals(schema, results.getSchema()); p.run(); }