Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[flink] Infer parallelism only in situation of parallelism is not set. #4975

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

leaves12138
Copy link
Contributor

Purpose

default.parallelism is not working because scan.infer-parallelism is default true

Tests

API and Format

Documentation

@@ -81,6 +81,8 @@ void testInferScanParallelism() throws Exception {
null);
PaimonDataStreamScanProvider runtimeProvider = runtimeProvider(tableSource);
StreamExecutionEnvironment sEnv1 = StreamExecutionEnvironment.createLocalEnvironment();
sEnv1.setParallelism(-1);
System.out.println(sEnv1.getParallelism());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This print seems unnecessary.

@@ -149,9 +149,18 @@ protected Integer inferSourceParallelism(StreamExecutionEnvironment env) {
Boolean.parseBoolean(envConfig.toMap().get(FLINK_INFER_SCAN_PARALLELISM)));
}
Integer parallelism = options.get(FlinkConnectorOptions.SCAN_PARALLELISM);
if (parallelism == null && options.get(FlinkConnectorOptions.INFER_SCAN_PARALLELISM)) {
if (parallelism == null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to understand the parallelism inferring logic this PR wants to achieve, please see if this is correct.

  1. If Paimon option SCAN_PARALLELISM is configured, then use this value.
  2. Else if Flink configuration parallelism.default is configured, then use this value.
  3. Else if Paimon option INFER_SCAN_PARALLELISM is set to true, and the parallelism of source can be inferred by Paimon (like when fixed bucket + unbounded stream), then Paimon would provide an inference result.
  4. Else Paimon would not set the parallelism of the source operator, instead it would be Flink infra that decide the parallelism of this operator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants