e-mhui commented on code in PR #7750:
URL: https://github.com/apache/inlong/pull/7750#discussion_r1155442137


##########
inlong-sort/sort-connectors/cdc-base/src/main/java/org/apache/inlong/sort/cdc/base/debezium/table/RowDataDebeziumDeserializeSchema.java:
##########
@@ -767,6 +786,33 @@ private GenericRowData extractBeforeRow(Struct value, 
Schema valueSchema) throws
         return (GenericRowData) physicalConverter.convert(before, 
beforeSchema);
     }
 
+    /**
+     * Extract ghost ddl record
+     *
+     * @param data
+     * @return
+     * @throws Exception
+     */
+    private GenericRowData extractGhostRecord(GenericRowData data) throws 
Exception {
+        String ddl = ((Map<String, 
String>)data.getField(0)).get(DDL_FIELD_NAME);
+        if (this.ghostTableRegex.startsWith(CARET) && 
this.ghostTableRegex.endsWith(DOLLAR)) {
+            this.ghostTableRegex = this.ghostTableRegex.substring(1, 
this.ghostTableRegex.length() - 1);

Review Comment:
   1. We need to extract tables from SQL, but usually tables are in the middle 
of SQL, `^_(.*)_(gho|ghc|del|new|old)$` can only match `_tb1_gho`, but cannot 
match `alter menghuiyu_tb1_gho add column c varchar(255)`. Therefore, we need 
to remove `^,$`.
   2. Generally, the default regular expression is suitable for most cases.
   3. Do you have any good suggestions for getting tables with gh-ost?



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