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

[Improve][SourceConnector] Unified schema parameter, update IoTDB sou… #3896

Merged
merged 7 commits into from
Jan 17, 2023

Conversation

sunnyzhuzhu
Copy link
Contributor

@sunnyzhuzhu sunnyzhuzhu commented Jan 7, 2023

Purpose of this pull request

close #3823

Check list

Copy link
Member

@CalvinKirs CalvinKirs left a comment

Choose a reason for hiding this comment

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

TBD: doc

@sunnyzhuzhu
Copy link
Contributor Author

TBD: doc

Thanks for your suggestions!I have updated doc and checked code style with docs/contribution/coding-guide.md. Can you help to approve the ci workflows again, since this is my first-time contribution. Thanks very much! @CalvinKirs

@TyrantLucifer
Copy link
Member

Thank you for your contribution. Let's waiting CI process.

Copy link
Member

@TyrantLucifer TyrantLucifer left a comment

Choose a reason for hiding this comment

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

Please update some code as #3897. You should update option rulle

Comment on lines 81 to 90
try {
Config schemaConfig = pluginConfig.getConfig(SeaTunnelSchema.SCHEMA.key());
this.typeInfo = SeaTunnelSchema.buildWithConfig(schemaConfig).getSeaTunnelRowType();
pluginConfig.entrySet().forEach(entry -> configParams.put(entry.getKey(), entry.getValue().unwrapped()));
} catch (Exception e) {
throw new IotdbConnectorException(SeaTunnelAPIErrorCode.CONFIG_VALIDATION_FAILED,
String.format("PluginName: %s, PluginType: %s, Message: %s",
getPluginName(), PluginType.SOURCE, e)
);
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
try {
Config schemaConfig = pluginConfig.getConfig(SeaTunnelSchema.SCHEMA.key());
this.typeInfo = SeaTunnelSchema.buildWithConfig(schemaConfig).getSeaTunnelRowType();
pluginConfig.entrySet().forEach(entry -> configParams.put(entry.getKey(), entry.getValue().unwrapped()));
} catch (Exception e) {
throw new IotdbConnectorException(SeaTunnelAPIErrorCode.CONFIG_VALIDATION_FAILED,
String.format("PluginName: %s, PluginType: %s, Message: %s",
getPluginName(), PluginType.SOURCE, e)
);
}
SeaTunnelSchema seaTunnelSchema = SeaTunnelSchema.buildWithConfig(pluginConfig.getConfig(SeaTunnelSchema.SCHEMA.key()));
this.typeInfo = seaTunnelSchema.getSeaTunnelRowType();
pluginConfig.entrySet().forEach(entry -> configParams.put(entry.getKey(), entry.getValue().unwrapped()));

Copy link
Member

Choose a reason for hiding this comment

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

Revert this logic. As is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@TyrantLucifer Thanks for your suggestions.I have done this.

@@ -49,7 +50,7 @@ public String factoryIdentifier() {
@Override
public OptionRule optionRule() {
return OptionRule.builder()
.required(NODE_URLS, USERNAME, PASSWORD, SQL)
.required(NODE_URLS, USERNAME, PASSWORD, SQL, SeaTunnelSchema.SCHEMA)
Copy link
Member

Choose a reason for hiding this comment

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

static import is better

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@TyrantLucifer Thanks for your suggestions.I have done this.

Copy link
Member

@TyrantLucifer TyrantLucifer left a comment

Choose a reason for hiding this comment

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

LGTM, thank you for your contirbution. Looking forward your next pull request! BTW, before this pr be merged CI should be passed. Let's waiting CI. cc @hailin0 @Hisoka-X @EricJoy2048 @CalvinKirs

@CalvinKirs
Copy link
Member

LGTM, thank you for your contirbution. Looking forward your next pull request! BTW, before this pr be merged CI should be passed. Let's waiting CI. cc @hailin0 @Hisoka-X @EricJoy2048 @CalvinKirs

I have one question, like this #3959

@TyrantLucifer
Copy link
Member

LGTM, thank you for your contirbution. Looking forward your next pull request! BTW, before this pr be merged CI should be passed. Let's waiting CI. cc @hailin0 @Hisoka-X @EricJoy2048 @CalvinKirs

I have one question, like this #3959

Unified parameters is convenient for frontend display the parameters. Do I understand right? @EricJoy2048

@EricJoy2048
Copy link
Member

LGTM, thank you for your contirbution. Looking forward your next pull request! BTW, before this pr be merged CI should be passed. Let's waiting CI. cc @hailin0 @Hisoka-X @EricJoy2048 @CalvinKirs

I have one question, like this #3959

Unified parameters is convenient for frontend display the parameters. Do I understand right? @EricJoy2048

Yes, I like this pr. Thanks for your contirbution.

@EricJoy2048 EricJoy2048 merged commit a0959c5 into apache:dev Jan 17, 2023
@CalvinKirs
Copy link
Member

LGTM, thank you for your contirbution. Looking forward your next pull request! BTW, before this pr be merged CI should be passed. Let's waiting CI. cc @hailin0 @Hisoka-X @EricJoy2048 @CalvinKirs↳↳

I have one question, like this #3959

Unified parameters is convenient for frontend display the parameters. Do I understand right? @EricJoy2048

Yes, I like this pr. Thanks for your contirbution.↳

I think you didn't get my point, what we need to consider is compatibility

@wfrong
Copy link
Contributor

wfrong commented Jan 17, 2023

LGTM, thank you for your contirbution. Looking forward your next pull request! BTW, before this pr be merged CI should be passed. Let's waiting CI. cc @hailin0 @Hisoka-X @EricJoy2048 @CalvinKirs↳↳

I have one question, like this #3959

Unified parameters is convenient for frontend display the parameters. Do I understand right? @EricJoy2048

Yes, I like this pr. Thanks for your contirbution.↳

I think you didn't get my point, what we need to consider is compatibility

I think you mean we should support previous usage only config fields without schema?

@sunnyzhuzhu
Copy link
Contributor Author

LGTM, thank you for your contirbution. Looking forward your next pull request! BTW, before this pr be merged CI should be passed. Let's waiting CI. cc @hailin0 @Hisoka-X @EricJoy2048 @CalvinKirs↳↳

I have one question, like this #3959

Unified parameters is convenient for frontend display the parameters. Do I understand right? @EricJoy2048

Yes, I like this pr. Thanks for your contirbution.↳

I think you didn't get my point, what we need to consider is compatibility

Sounds reasonable! Should I change on this pr to support previous usage that may exists in some users' jobs configure? @TyrantLucifer @EricJoy2048 @CalvinKirs

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

Successfully merging this pull request may close these issues.

[Improve][SourceConnector] Unified schema parameter, update IoTDB source fields to schema
6 participants