You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "tobezhou33 (via GitHub)" <gi...@apache.org> on 2023/04/11 03:56:42 UTC

[GitHub] [incubator-seatunnel] tobezhou33 commented on a diff in pull request #4504: [Improve][core/transformv2]flink transform v2 use richflatmap instead flatmap

tobezhou33 commented on code in PR #4504:
URL: https://github.com/apache/incubator-seatunnel/pull/4504#discussion_r1162274116


##########
seatunnel-core/seatunnel-flink-starter/seatunnel-flink-starter-common/src/main/java/org/apache/seatunnel/core/starter/flink/execution/TransformExecuteProcessor.java:
##########
@@ -120,7 +121,19 @@ protected DataStream<Row> flinkTransform(SeaTunnelTransform transform, DataStrea
                 new FlinkRowConverter(transform.getProducedType());
         DataStream<Row> output =
                 stream.flatMap(
-                        new FlatMapFunction<Row, Row>() {
+                        new RichFlatMapFunction<Row, Row>() {
+                            @Override
+                            public void open(Configuration parameters) throws Exception {
+                                super.open(parameters);

Review Comment:
   the SeaTunnelTransform interface default has func open() and close() when transform initialed and completed,but FlatMapFunction dont have open and close func ,when user define transform have do sth in open() or close(), the FlatMapFunction cant satisfy, such as SQLTransform。



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org