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

[bigfix][S3 File]:Change the [SCHEMA] attribute of the [S3CONF class] to be non-static to avoid being reassigned after deserialization #6717

Merged
merged 2 commits into from
Apr 17, 2024

Conversation

LeonYoah
Copy link
Contributor

@LeonYoah LeonYoah commented Apr 16, 2024

Purpose of this pull request

fix bug : #6678
The [S3Conf] class in the S3 connector has a statically modified variable [SCHEMA], which causes it to be reassigned after deserialization. I will remove the static modification:
image
image
close #6678

Does this PR introduce any user-facing change?

No

How was this patch tested?

Check list

… to be non-static to avoid being reassigned after deserialization
@@ -73,13 +77,13 @@ public static HadoopConf buildWithConfig(Config config) {

public static HadoopConf buildWithReadOnlyConfig(ReadonlyConfig readonlyConfig) {
Config config = readonlyConfig.toConfig();
HadoopConf hadoopConf = new S3Conf(readonlyConfig.get(S3ConfigOptions.S3_BUCKET));
String bucketName = readonlyConfig.get(S3ConfigOptions.S3_BUCKET);
String bucketName = config.getString(S3ConfigOptions.S3_BUCKET.key());
Copy link
Member

Choose a reason for hiding this comment

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

Can reuse the code above:

return buildWithReadOnlyConfig(readonlyConfig.toConfig);

… to be non-static to avoid being reassigned after deserialization
Copy link
Member

@EricJoy2048 EricJoy2048 left a comment

Choose a reason for hiding this comment

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

LGTM, waiting for CI complete.

@hailin0 hailin0 merged commit 79bb701 into apache:dev Apr 17, 2024
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants