jw-itq commented on code in PR #8082:
URL: https://github.com/apache/seatunnel/pull/8082#discussion_r1861560148
##########
seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/sink/StarRocksSinkWriter.java:
##########
@@ -68,6 +86,50 @@ record = serializer.serialize(element);
manager.write(record);
}
+ @Override
+ public void applySchemaChange(SchemaChangeEvent event) {
+ if (event instanceof AlterTableColumnsEvent) {
+ AlterTableColumnsEvent alterTableColumnsEvent =
(AlterTableColumnsEvent) event;
+ List<AlterTableColumnEvent> events =
alterTableColumnsEvent.getEvents();
+ for (AlterTableColumnEvent alterTableColumnEvent : events) {
+ String sourceDialectName =
alterTableColumnEvent.getSourceDialectName();
+ if (StringUtils.isBlank(sourceDialectName)) {
+ throw new SeaTunnelException(
+ "The sourceDialectName in AlterTableColumnEvent
can not be empty. event: "
+ + event);
+ }
+ processSchemaChangeEvent(alterTableColumnEvent);
+ }
+ } else {
+ log.warn("We only support AlterTableColumnsEvent, but actual event
is " + event);
+ }
+
+ try {
+ Class.forName("com.mysql.cj.jdbc.Driver");
+ } catch (ClassNotFoundException e) {
+ throw new RuntimeException(e);
+ }
+
+ try {
+ Connection conn =
Review Comment:
> Why not close connection ?
sorry, I'll optimize it
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]