Created
January 8, 2019 23:29
-
-
Save imrenagi/0e0886a18909f7c964eaffd01dc9d667 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PCollection<String> names = ...; | |
PCollection<String> fooCollection = names.apply("FooTrans", ParDo.of(new DoFn<String, String>(){ | |
@ProcessElement | |
public void processElement(ProcessContext c) { | |
if(c.element().startsWith("Foo")){ | |
c.output(c.element()); | |
} | |
}})); | |
PCollection<String> errCollection = names.apply("BarTrans", ParDo.of(new DoFn<String, String>(){ | |
@ProcessElement | |
public void processElement(ProcessContext c) { | |
if(c.element().startsWith("Bar")){ | |
c.output(c.element()); | |
} | |
} | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment