Apache Beam-PCollection <Object []>到PCollection <Object>

时间:2019-11-25 18:08:50

标签: java apache-beam dataflow

我有一个Json文件,其内容是每行一个对象数组,可以将Object []的PCollection转换为Object的PCollection吗?

PCollection<String> events = 
        p.apply(TextIO.read()
                .from("C:\\data\\*.zip")
                .withCompression(Compression.ZIP));


PCollection<User[]> objectsArray = events.apply(ParseJsons.of(User[].class))
        .setCoder(SerializableCoder.of(User[].class));


PCollection<User> object = objectsArray.apply( ????? );

0 个答案:

没有答案