-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
Thank you for your contribution. Let's waiting CI process. |
There was a problem hiding this 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
...-iotdb/src/main/java/org/apache/seatunnel/connectors/seatunnel/iotdb/source/IoTDBSource.java
Outdated
Show resolved
Hide resolved
...-iotdb/src/main/java/org/apache/seatunnel/connectors/seatunnel/iotdb/source/IoTDBSource.java
Outdated
Show resolved
Hide resolved
c2f0209
to
0213cc1
Compare
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) | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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())); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static import is better
There was a problem hiding this comment.
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.
…rce fields to schema
605d990
to
173697a
Compare
There was a problem hiding this 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
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? |
Sounds reasonable! Should I change on this pr to support previous usage that may exists in some users' jobs configure? @TyrantLucifer @EricJoy2048 @CalvinKirs |
Purpose of this pull request
close #3823
Check list
New License Guide
release-note
.