shouweikun commented on a change in pull request #13789: URL: https://github.com/apache/flink/pull/13789#discussion_r513167212
########## 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: @JingsongLi it is recommended to use the Optional only in method return values copy that. I think we don't need provide method. Well, since `SinkFunctionProvider ` implements `ParallelismProvider` as default, as far as I’m concerned, there should be a method passing the parallelism in. Or Is there an better alternative? It‘s kind of u to tell me that~ ---------------------------------------------------------------- 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