public static void updateGhostDdlElement(SourceRecord element, MySqlSplitState splitState,
            HistoryRecord historyRecord,
            String ghostTableRegex) {
        String tableNames = org.apache.inlong.sort.cdc.mysql.source.utils.RecordUtils.getTableName(element);
        for (String tableName : tableNames.split(",")) {
            Pattern compile = Pattern.compile(ghostTableRegex);
            Matcher matcher = compile.matcher(tableName);
            if (matcher.find()) {
                tableName = matcher.group(1);
                TableId tableId = getTableId(element, tableName);
                String ddl = splitState.asBinlogSplitState().getTableDdls().get(tableId);
                Struct value = (Struct) element.value();
                // update source.table and historyRecord
                value.getStruct(Fields.SOURCE).put(TABLE_NAME, tableName);
                value.put(HISTORY_RECORD_FIELD, historyRecord.document().set(Fields.DDL_STATEMENTS, ddl).toString());
            }
        }
    }
if gh-ost output the 'rename table`_a_gho` to `a`' ddl statement (where `a` is the captured table
and `_a_gho` is the gh-ost table), its tableChanges won't be empty, and the tableName will contain
both the captured table and the gh-ost generated table.
We should retrieve the alter statements generated by gh-ost from the state and update the `source.table`
and `historyRecord` values of the element.
inlong-sort/sort-flink/sort-flink-v1.13/sort-connectors/mysql-cdc/src/main/java/org/apache/inlong/sort/cdc/mysql/source/utils/GhostUtils.java