hailin0 commented on code in PR #8082:
URL: https://github.com/apache/seatunnel/pull/8082#discussion_r1861961496


##########
seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/sink/StarRocksSinkWriter.java:
##########
@@ -68,6 +79,41 @@ record = serializer.serialize(element);
         manager.write(record);
     }
 
+    @Override
+    public void applySchemaChange(SchemaChangeEvent event) {
+        this.tableSchema = 
tableSchemaChangeEventDispatcher.reset(tableSchema).apply(event);
+        SeaTunnelRowType seaTunnelRowType = 
tableSchema.toPhysicalRowDataType();
+        this.serializer = createSerializer(sinkConfig, seaTunnelRowType);
+        this.manager = new StarRocksSinkManager(sinkConfig, tableSchema);
+
+        try {
+            Class.forName("com.mysql.cj.jdbc.Driver");
+        } catch (ClassNotFoundException e) {
+            throw new RuntimeException("Failed to load MySQL JDBC driver", e);
+        }
+
+        Connection conn = null;
+        try {

Review Comment:
   ```suggestion
           try (Connection conn = DriverManager.getConnection(...)) {
   ```



-- 
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]

Reply via email to