Hello everyone,
I am working on apache flink.
I have made a flink job which does some event processing and then pushing into database and kafka(sink).
The job is working fine.
So the problem is with
parallelism 1 it is producing 1599 events to kafka which is perfect, but when I increase
parallelism to
8 my flink job is producing 1599*8= 12792 events to kafka.
It should produce same 1599 events only.
I am not sure what is the problem.
Someone please assist me with some solution or any idea.
My job overview is :
1 - Building schema for creating Table
2 - DataStream
String fileStream = reading csv file from url
3 - DataStream<Tuple3
String, Row, String> mappedDataStreamWithEntityId = from fileStream
4 - DataStream<Tuple4
String, Row, String, String> resultStream2 = combined stream from mappedDataStreamWithEntityId
5 - DataStream
Row finalMappedStream = converted
mappedDataStreamWithEntityId to DataStream
Row for creating
Table
6 - Table inputTable = tableEnv.fromDataStream(finalMappedStream, schema)
7 - tableEnv.createTemporaryView("inMemoryTable", inputTable);
8 - looping and executing sql queries on temporary view.
Table queryResult = tableEnv.sqlQuery(groupQuery);
9 - creating DataStream
Row from queryResult : DataStream
Row resultStream = tableEnv.toDataStream(queryResult);
10 - DataStream
Event dataStreamResult = resultStream
11 -
if (allQueryResultStream == null) allQueryResultStream = dataStreamResult;
else {
allQueryResultStream = allQueryResultStream.union(dataStreamResult);
}