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



##########
File path: 
flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/nodes/common/CommonPhysicalSink.scala
##########
@@ -99,11 +110,57 @@ class CommonPhysicalSink (
 
         val operator = new SinkOperator(env.clean(sinkFunction), 
rowtimeFieldIndex, enforcer)
 
+        assert(runtimeProvider.isInstanceOf[ParallelismProvider],
+          "runtimeProvider with `ParallelismProvider` implementation is 
required")
+
+        val inputParallelism = inputTransformation.getParallelism
+        val parallelism =  {
+          val parallelismOptional = 
runtimeProvider.asInstanceOf[ParallelismProvider].getParallelism
+          if(parallelismOptional.isPresent) {
+            val parallelismPassedIn = parallelismOptional.get().intValue()
+            if(parallelismPassedIn <= 0) {
+              throw new TableException(s"Table: $tableIdentifier configured 
sink parallelism: " +
+                s"$parallelismPassedIn should not be less than zero or equal 
to zero")
+            }
+            parallelismPassedIn
+          } else {
+            inputParallelism
+          }
+        }
+
+        val primaryKeys = 
TableSchemaUtils.getPrimaryKeyIndices(catalogTable.getSchema)
+        val theFinalInputTransformation = if (inputParallelism == parallelism) 
{

Review comment:
       if (inputParallelism == parallelism || 
changelogMode.containsOnly(RowKind.INSERT)) {
   }




----------------------------------------------------------------
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:
[email protected]


Reply via email to