You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by "EMsnap (via GitHub)" <gi...@apache.org> on 2023/04/03 02:23:16 UTC

[GitHub] [inlong] EMsnap commented on a diff in pull request #7750: [INLONG-7554][Sort] MySQL CDC supports parsing gh-ost records

EMsnap commented on code in PR #7750:
URL: https://github.com/apache/inlong/pull/7750#discussion_r1155431301


##########
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:
   why remove $ and ^ ? 
   BTW what if a regex only has ^ at the beginning and no $ at the end ?



-- 
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-unsubscribe@inlong.apache.org

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