You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by GitBox <gi...@apache.org> on 2022/02/23 12:41:26 UTC

[GitHub] [incubator-seatunnel] asdf2014 commented on a change in pull request #1287: [Feature] [flink] Remove flink DataSet api (#1246)

asdf2014 commented on a change in pull request #1287:
URL: https://github.com/apache/incubator-seatunnel/pull/1287#discussion_r812850642



##########
File path: seatunnel-connectors/seatunnel-connector-flink-druid/src/main/java/org/apache/seatunnel/flink/sink/DruidSink.java
##########
@@ -45,14 +47,16 @@
     private String timestampFormat;
     private String timestampMissingValue;
 
+    @Nullable
     @Override
-    public DataSink<Row> outputBatch(FlinkEnvironment env, DataSet<Row> dataSet) {
-        DataSink<Row> dataSink = dataSet.output(new DruidOutputFormat(coordinatorURL, datasource, timestampColumn, timestampFormat, timestampMissingValue));
+    public DataStreamSink<Row> outputStream(FlinkEnvironment env, DataStream<Row> dataStream) {
+        DataStreamSink<Row> rowDataStreamSink = dataStream.addSink(new DruidSinkFunction<>(
+                new DruidOutputFormat<>(coordinatorURL, datasource, timestampColumn, timestampFormat, timestampMissingValue)));
         if (config.hasPath(PARALLELISM)) {
             int parallelism = config.getInt(PARALLELISM);
-            return dataSink.setParallelism(parallelism);
+            rowDataStreamSink.setParallelism(parallelism);
         }
-        return dataSink;
+        return null;

Review comment:
       May I ask why we don't return the sink instance here




-- 
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