tencent cloud

All product documents
Tencent Cloud WeData
Supported DML and DDL Operations
Last updated: 2024-11-01 17:05:07
Supported DML and DDL Operations
Last updated: 2024-11-01 17:05:07

DDL Change Types and Response Policies

Real-time whole database tasks support monitoring data source DDL changes and synchronizing the source changes to the target in real-time. Supported DDL scenarios and corresponding policies are as follows:
DDL
Description
Create a Table
1. Automatic Table Creation: When a new table appears in the monitored source database, the target will automatically create a table with the same structure and fields.
2. Ignore Changes: The target ignores the DDL change messages from the source. The target and logs do not respond or issue any alerts.
3. Log Alarms: The target will only receive DDL change messages and log the message contents without triggering any table creation operations.
4. Task Error: The target receives DDL change messages and continuously restarts the task. During the restart process, the task logs errors and data write exceptions occur.
Add a Column
1. Auto-add Columns: When a new column appears in the monitored source table, the target will automatically create a column with the same name.
2. Ignore Changes: The target ignores the DDL change messages from the source. The target and logs do not respond or issue any alerts.
3. Log Alarms: The target will only receive DDL change messages and log the message contents without triggering any column creation operations.
4. Task Error: The target receives DDL change messages and continuously restarts the task. During the restart process, the task logs errors and data write exceptions occur.
Delete a Column
1. Automatic deletion of columns: When a column is deleted in the monitored source table, the target will automatically delete the column with the same name.
2. Ignore Changes: The target ignores the DDL change messages from the source. The target and logs do not respond or issue any alerts.
3. Log Alarms: The target will only receive DDL change messages and log the message contents. This policy does not trigger any column deletion operations.
4. Task Error: The target receives DDL change messages and continuously restarts the task. During the restart process, the task logs errors and data write exceptions occur.
Rename a column
1. Automatic renaming of columns: When a column name changes in the monitored source table, the target will automatically rename the column.
2. Ignore Changes: The target ignores the DDL change messages from the source. The target and logs do not respond or issue any alerts.
3. Log Alarms: The target will only receive DDL change messages and log the message contents. This policy does not trigger any column renaming operations.
4. Task Error: The target receives DDL change messages and continuously restarts the task. During the restart process, the task logs errors and data write exceptions occur.
Column type modification
1. Automatic modification of column types: When there is a column type change in the monitored database on the source end, such as field length change or adding a comment, the target end will automatically make the corresponding change.
2. Ignore Changes: The target ignores the DDL change messages from the source. The target and logs do not respond or issue any alerts.
3. Log Alerts: The target will only receive DDL change messages and log the message content. This policy does not trigger column type modification operations.
4. Task Error: The target receives DDL change messages and continuously restarts the task. During the restart process, the task logs errors and data write exceptions occur.
Delete a Table
1. Ignore Changes: The target ignores the DDL change messages from the source. The target and logs do not respond or issue any alerts.
2. Log Alerts: The target will only receive DDL change messages and log the message content. This policy does not trigger Delete Table/Rename Table/Empty Table operations.
3. Task Error: The target receives DDL change messages and continuously restarts the task. During the restart process, the task logs errors and data write exceptions occur.
Rename a Table
Empty Table
Note:
For "high-risk" table-level operations on the source end, such as deleting, emptying, or renaming a table, the target end does not support automatic responses. That is, the target end will not automatically delete, empty, or rename the table.

Overview of DML and DDL Support

Whether the target end can automatically synchronize the source end's DML and DDL changes depends on whether the source end can capture these changes, and whether the target end can respond to them. When both the source and target ends support it, the corresponding link can support the corresponding DDL changes. For example, if the MySQL source end supports adding columns, and the DLC target end supports adding columns, then columns added in the MySQL source table can automatically be added in the DLC target end; if the MySQL source end supports deleting tables, but the Doris target end does not support deleting tables, then tables deleted in the MySQL data source will not automatically be deleted on the Doris target end.
The DML, DDL types, and message processing supported by different source and target ends vary. The following table shows the support status for some data sources. Refer to the product page configuration for details.
Note:
1. Read: "Yes" means the read end can perceive the corresponding DML and DDL operations and pass the changes downstream.
2. Write: "Yes" indicates that the write end can follow the corresponding DML, DDL changes.
3. DDL change responses are currently only supported in the incremental phase. The full volume phase does not support DDL changes.
Type
Read (Source side)
DML
DDL
Insert
Delete
Updating
Add a Column
Delete a Column
Rename a column
Column type modification
Add Table
Rename a Table
Delete a Table
Empty Table
MySQL
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
TDSQL-C
MySQL
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
TDSQL MySQL
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Oracle
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
SQL Server
Yes
Yes
Yes
No
No
No
No
No
No
No
No
PostgreSQL
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Yes
OceanBase
Yes
Yes
Yes
No
No
No
No
No
No
No
No
Kafka
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
Type
Write (Target end)
DML
DDL
Insert
Delete
Updating
Add a Column
Delete a Column
Rename a column
Column type modification
Add Table
Rename a Table
Delete a Table
Empty Table
DLC
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
No
Iceberg
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
No
Doris
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
No
StarRocks
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
No
No
No
TChouse-P
Yes
Yes
Yes
Yes
No
No
No
Yes
No
No
No
Elasticsearch
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
No
No
No
Hive
Yes
No
No
No
No
No
No
No
No
No
No
Kafka
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA

DDL Parse Grammar Requirements

Note:
Only SQL that meets DDL type and syntax requirements can be parsed and responded to by the source-side. Unsupported SQL statements may lead to situations like task abnormal restarts. Please assess whether common syntax used in business table structure changes meets the requirements, and configure DDL change response and write exception handling strategies that match business needs.

MySQL

1. Rename Table supports the following syntax:
RENAME TABLE tbl_name TO new_tbl_name
2. Create New Table supports the following syntax:
CREATE TABLE [IF NOT EXISTS] tbl_name (create_definition,...) CREATE TABLE new_tbl LIKE orig_tbl; CREATE TABLE new_tbl AS SELECT * FROM orig_tbl;
Warning:
Constraints such as CHECK \\ TemporaryTable are not supported
3. Modify Column / Rename Column supports the following syntax:
ALTER TABLE t1 MODIFY b INT NOT NULL; ALTER TABLE t1 CHANGE b a INT NOT NULL;
4. Add Column / Rename Column supports the following syntax:
ALTER TABLE table_name ADD new_column_name column_definition [ FIRST | AFTER column_name ];
5. Delete Column supports the following syntax:
Alter table t2 DROP [COLUMN] col_name
6. Empty Table supports the following syntax:
truncate table a;
7. Drop Table supports the following syntax:
drop table a;

Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 available.

7x24 Phone Support
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon