JingsongLi commented on a change in pull request #13789:
URL: https://github.com/apache/flink/pull/13789#discussion_r513169206



##########
File path: 
flink-table/flink-table-api-java-bridge/src/main/java/org/apache/flink/table/connector/sink/SinkFunctionProvider.java
##########
@@ -20,19 +20,39 @@
 
 import org.apache.flink.annotation.PublicEvolving;
 import org.apache.flink.streaming.api.functions.sink.SinkFunction;
+import org.apache.flink.table.connector.ParallelismProvider;
 import org.apache.flink.table.data.RowData;
 
+import java.util.Optional;
+
 /**
  * Provider of a {@link SinkFunction} instance as a runtime implementation for 
{@link DynamicTableSink}.
  */
 @PublicEvolving
-public interface SinkFunctionProvider extends 
DynamicTableSink.SinkRuntimeProvider {
+public interface SinkFunctionProvider extends 
DynamicTableSink.SinkRuntimeProvider, ParallelismProvider {
 
        /**
         * Helper method for creating a static provider.
         */
        static SinkFunctionProvider of(SinkFunction<RowData> sinkFunction) {
-               return () -> sinkFunction;
+               return of(sinkFunction, Optional.empty());
+       }
+
+       /**
+        * Helper method for creating a static provider, sink parallelism will 
be configured if non-empty parallelism is passed in.
+        */
+       static SinkFunctionProvider of(SinkFunction<RowData> sinkFunction, 
Optional<Integer> parallelism) {

Review comment:
       For the user which want to set parallelism, I think it is OK to let them 
create an implementation class.




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

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


Reply via email to