flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yassin Marzouki <yassmar...@gmail.com>
Subject Strange behaviour of the flatMap Collector
Date Thu, 11 Aug 2016 12:29:22 GMT
Hi all,

When I use out.collect() twice inside a faltMap, the output is sometimes
and randomly skewed. Take this example:

final StreamExecutionEnvironment env =
StreamExecutionEnvironment.createLocalEnvironment();
    env.generateSequence(1, 100000)
        .flatMap((Long t, Collector<String> out) -> {
            out.collect("line1");
            out.collect("line2");
        })

.writeAsText("test",FileSystem.WriteMode.OVERWRITE).setParallelism(1);
env.execute("Test");

I expect the output to be
line1
line2
line1
line2
...

But some resulting lines (18 out of 200000) were:
line2
line2
and the same for line1.

What could be the reason for this?

Best,
Yassine

Mime
View raw message