Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Description MYSQL-CDC failed to synchronize data #7571

Closed
3 tasks done
gaotong521 opened this issue Sep 4, 2024 · 2 comments
Closed
3 tasks done

Description MYSQL-CDC failed to synchronize data #7571

gaotong521 opened this issue Sep 4, 2024 · 2 comments

Comments

@gaotong521
Copy link

Search before asking

  • I had searched in the issues and found no similar issues.

What happened

When using mysqL-CDC to synchronize data, both the source table and the target table are of mysql type. If the two tables have different structures, data synchronization will fail even if the transform of field mapping is configured

SeaTunnel Version

2.3.5

SeaTunnel Config

{
    "env": {
        "job.mode": "STREAMING",
        "job.name": "seatunnel_mysql_cdc",
        "parallelism": 1,
        "checkpoint.interval": 1000
    },
    "source": [
        {
            "plugin_name": "MySQL-CDC",
            "base-url": "jdbc:mysql://127.0.0.1:3306/data_source_test",
            "username": "root",
            "password": "root",
            "table-names": [
                "data_source_test.cn_region_dict"
            ],
            "snapshot.split.size": 100000,
            "startup.mode": "initial",
            "result_table_name": "table_source_001"
        }
    ],
    "transform": [
        {
            "plugin_name": "Replace",
            "source_table_name": "table_source_001",
            "result_table_name": "table_source_002",
            "replace_field": "region_name",
            "pattern": "==",
            "replacement": "--",
            "is_regex": false,
            "replace_first": false
        },
        {
            "plugin_name": "FieldMapper",
            "source_table_name": "table_source_002",
            "result_table_name": "table_source_003",
            "field_mapper": {
                "id": "id_old",
                "region_code": "region_code_old",
                "parent_region_code": "parent_region_code",
                "region_name": "region_name_old",
                "region_level": "region_level_old",
                "longitude": "longitude",
                "latitude": "latitude",
                "zoom_level": "zoom_level",
                "sort_id": "sort_id",
                "deleted": "deleted",
                "create_time": "create_time"
            }
        }
    ],
    "sink": [
        {
            "source_table_name": "table_source_003",
            "plugin_name": "Jdbc",
            "url": "jdbc:mysql://127.0.0.1:3306/data_dest_test?rewriteBatchedStatements=true",
            "database": "data_dest_test",
            "table": "data_dest_test.cn_region_dict",
            "user": "root",
            "password": "root",
            "driver": "com.mysql.jdbc.Driver",
            "generate_sink_sql": true,
            "schema_save_mode": "CREATE_SCHEMA_WHEN_NOT_EXIST",
            "data_save_mode": "DROP_DATA"
        }
    ]
}

Running Command

Run via dolphinscheduler

Error Exception

When the source table is updated, the target table data does not change

Zeta or Flink or Spark Version

No response

Java or Scala Version

No response

Screenshots

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@gaotong521 gaotong521 added the bug label Sep 4, 2024
Copy link

github-actions bot commented Oct 5, 2024

This issue has been automatically marked as stale because it has not had recent activity for 30 days. It will be closed in next 7 days if no further activity occurs.

@github-actions github-actions bot added the stale label Oct 5, 2024
Copy link

github-actions bot commented Nov 9, 2024

This issue has been closed because it has not received response for too long time. You could reopen it if you encountered similar problems in the future.

@github-actions github-actions bot closed this as completed Nov 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant