DongLiang-0 commented on code in PR #422:
URL: 
https://github.com/apache/doris-flink-connector/pull/422#discussion_r1678889671


##########
flink-doris-connector/src/main/java/org/apache/doris/flink/sink/writer/serializer/jsondebezium/JsonDebeziumSchemaChangeImplV2.java:
##########
@@ -137,50 +134,33 @@ public boolean schemaChange(JsonNode recordRoot) {
                     LOG.info("create table ddl status: {}", status);
                 }
             } else if (eventType.equals(EventType.ALTER)) {
-                // db,table
-                Tuple2<String, String> tuple = getDorisTableTuple(recordRoot);
-                if (tuple == null) {
+                Tuple2<String, String> dorisTableTuple = 
getDorisTableTuple(recordRoot);
+                if (dorisTableTuple == null) {
+                    LOG.warn("Failed to get doris table tuple. record={}", 
recordRoot);
                     return false;
                 }
                 List<String> ddlSqlList = extractDDLList(recordRoot);
-                if (CollectionUtils.isEmpty(ddlSqlList)) {
-                    LOG.info("ddl can not do schema change:{}", recordRoot);
-                    return false;
-                }
-                List<DDLSchema> ddlSchemas = 
SchemaChangeHelper.getDdlSchemas();
-                for (int i = 0; i < ddlSqlList.size(); i++) {
-                    DDLSchema ddlSchema = ddlSchemas.get(i);
-                    String ddlSql = ddlSqlList.get(i);
-                    boolean doSchemaChange = checkSchemaChange(tuple.f0, 
tuple.f1, ddlSchema);
-                    status = doSchemaChange && 
schemaChangeManager.execute(ddlSql, tuple.f0);
-                    LOG.info("schema change status:{}, ddl:{}", status, 
ddlSql);
-                }
-            } else {
-                LOG.info("Unsupported event type {}", eventType);

Review Comment:
   `extractEventType(JsonNode record)`only returns three types of events, 
namely `ALTER`, `CREATE`, and `null`. where `null` has been handled here
   <img width="663" alt="image" 
src="https://github.com/user-attachments/assets/088569cb-8d01-40b4-a255-ae05c30a2b25";>
   



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to