You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "reswqa (via GitHub)" <gi...@apache.org> on 2023/05/25 17:14:17 UTC
[GitHub] [incubator-paimon] reswqa commented on a diff in pull request #1230: [flink] Respect scan.parallelism whatever the case
reswqa commented on code in PR #1230:
URL: https://github.com/apache/incubator-paimon/pull/1230#discussion_r1205805294
##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/source/AbstractDataTableSource.java:
##########
@@ -214,7 +214,7 @@ private DataStream<RowData> configureSource(
FlinkSourceBuilder sourceBuilder, StreamExecutionEnvironment env) {
Options options = Options.fromMap(this.table.options());
Integer parallelism = options.get(FlinkConnectorOptions.SCAN_PARALLELISM);
- if (options.get(FlinkConnectorOptions.INFER_SCAN_PARALLELISM)) {
+ if (parallelism == null && options.get(FlinkConnectorOptions.INFER_SCAN_PARALLELISM)) {
Review Comment:
It seems that we did not perform boundary check(e.g. `>0`) on `parallelism`. If `SCAN_PARALLELISM` is set to `-1`, `OperatorValidationUtils.validateParallelism` will not reject it because it is equal to `ExecutionConfig.PARALLELISM_DEFAULT`, which may cause some confusion. But it can always be argued that this is the behavior supported by `flink` (-1 is considered the default parallelism). Just a comment, maybe not do this check here is exactly the right one. 🤔
##########
paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/ReadWriteTableITCase.java:
##########
@@ -1213,10 +1213,10 @@ public void testInferParallelism() throws Exception {
new HashMap<String, String>() {
{
put(INFER_SCAN_PARALLELISM.key(), "true");
- put(SCAN_PARALLELISM.key(), "-1");
Review Comment:
Perhaps we should keep this case and assert that it will throw an `IllegalArgumentException`. But `-1` should be changed to another illegal value (such as `-2`), as explained in the previous comment.
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org