Does anyone have any thoughts or concerns with me changing the example code
to use the new TypeDescriptors class from the inline creation of a
TypeDescriptor?

For example, MinimalWordCountJava8 would change from:


p.apply(TextIO.Read.from("gs://dataflow-samples/shakespeare/*"))

    .apply(FlatMapElements.via((String word) ->
Arrays.asList(word.split("[^a-zA-Z']+")))

        .withOutputType(new TypeDescriptor<String>() {}))

to:

p.apply(TextIO.Read.from("gs://dataflow-samples/shakespeare/*"))

    .apply(FlatMapElements.via((String word) ->
Arrays.asList(word.split("[^a-zA-Z']+")))
        .withOutputType(strings()))

I'd use a static import to decrease the code footprint.

Thanks,

Jesse

Reply via email to