wuchong commented on a change in pull request #8718:
[FLINK-12824][table-planner-blink] Set parallelism for stream SQL
URL: https://github.com/apache/flink/pull/8718#discussion_r293752274
##########
File path:
flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/nodes/physical/stream/StreamExecSink.scala
##########
@@ -121,6 +122,19 @@ class StreamExecSink[T](
"implemented and return the sink transformation DataStreamSink. " +
s"However, ${sink.getClass.getCanonicalName} doesn't implement
this method.")
}
+ val configSinkParallelism = NodeResourceConfig.getSinkParallelism(
+ tableEnv.getConfig.getConf)
+
+ val maxSinkParallelism = dsSink.getTransformation.getMaxParallelism
+
+ if (maxSinkParallelism > 0 && configSinkParallelism <=
maxSinkParallelism) {
+ dsSink.getTransformation.setParallelism(configSinkParallelism)
+ }
+ if (!UpdatingPlanChecker.isAppendOnly(this) &&
+ dsSink.getTransformation.getParallelism !=
transformation.getParallelism) {
+ throw new TableException("Sink parallelism should be equal to input
node when it is not" +
Review comment:
Improve the exception message:
"The configured sink parallelism should be equal to the input node when
input is an update stream. The input parallelism is ${...}, however the
configured sink parallelism is ${...}"
----------------------------------------------------------------
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]
With regards,
Apache Git Services