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

[Feature][Connector-V2] StarRocks-sink support schema evolution #8082

Open
wants to merge 28 commits into
base: dev
Choose a base branch
from

Conversation

jw-itq
Copy link
Contributor

@jw-itq jw-itq commented Nov 19, 2024

Feature #8034

Purpose of this pull request

Does this PR introduce any user-facing change?

How was this patch tested?

Check list

@Hisoka-X
Copy link
Member

cc @hailin0 @dailai

}

@TestTemplate
public void testStarRocksSinkWithSchemaEvolutionCase(TestContainer container)
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, thanks

@hailin0 hailin0 added the ddl label Nov 23, 2024
@@ -40,16 +39,15 @@
public class StarRocksSink extends AbstractSimpleSink<SeaTunnelRow, Void>
implements SupportSaveMode {
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, thanks!


@Slf4j
public class StarRocksSinkWriter extends AbstractSinkWriter<SeaTunnelRow, Void> {
public class StarRocksSinkWriter extends AbstractSinkWriter<SeaTunnelRow, Void>
implements SupportSchemaEvolutionSinkWriter, SupportSchemaEvolutionSink {
Copy link
Member

Choose a reason for hiding this comment

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

move SupportSchemaEvolutionSink to StarRocksSink

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok,thanks,I was negligent

throw new SeaTunnelException(
"Unsupported schemaChangeEvent for event type: " + event.getEventType());
}
this.tableSchema =
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
this.tableSchema =
this.tableSchema = TableSchemaChangeEventDispatcher.reset(..).apply(event);

@hailin0
Copy link
Member

hailin0 commented Nov 24, 2024

reference
#8134

@jw-itq
Copy link
Contributor Author

jw-itq commented Nov 24, 2024

reference #8134

ok,I'll try again,thanks

Copy link
Member

@hailin0 hailin0 left a comment

Choose a reason for hiding this comment

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

* @param afterColumn column before the new column
* @return alter table sql for sink table after schema change
*/
public static String buildAlterTableSql(
Copy link
Member

Choose a reason for hiding this comment

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

It doesn't need to be so complicated, please simplify the code.

reference
#8134

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok,I optimizing the code,thanks.

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.

3 participants