Hi, You can see the execution plan via StreamExecutionEnvironment#getExecutionPlan(). You can visualize it in[1]. You can also submit your job and check the execution plan in Web UI.
As for the question which option is preferred it is very subjective. As long as in the option b) both maps are chained, there will be no much difference how the two options behave. Executing the map(2) will be just a method call. You could also think about completely separating the tasks: convertedFields = datastream.map(#convertFields) convertedFields.addSink(.../*write to DB*/); convertedFields.map(/* convert to avro */); Best, Dawid [1] https://flink.apache.org/visualizer/ On 05/09/2020 01:13, Vijayendra Yadav wrote: > Hi Team, > > I have a generic Question. > > Let's say I have 2 Actions to be taken on Flink DATASTREAM (Kafka). > 1) Convert some data fields, and write to external Database > 2) Transform #1 converted data fields in to different record format > say AVRO > > *Here are Two approaches that are possible.* > > a) One Map function doing both #1 and #2 actions > > *datastream.map(1)* > > b) Two maps doing separate Actions #1 and #2 . > > *datastream.map().map(1).map(2) * > * > * > Which one would you prefer ? > > Is there a way I can see Execution plan ? > * > * > Regards, > Vijay
signature.asc
Description: OpenPGP digital signature