yuxiqian commented on code in PR #3932:
URL: https://github.com/apache/flink-cdc/pull/3932#discussion_r1981278352
##########
flink-cdc-e2e-tests/flink-cdc-pipeline-e2e-tests/src/test/java/org/apache/flink/cdc/pipeline/tests/MysqlE2eITCase.java:
##########
@@ -545,9 +545,7 @@ public void testDanglingDropTableEventInBinlog() throws
Exception {
Path mysqlDriverJar = TestUtils.getResource("mysql-driver.jar");
submitPipelineJob(pipelineJob, mysqlCdcJar, valuesCdcJar,
mysqlDriverJar);
waitUntilJobRunning(Duration.ofSeconds(30));
- validateResult(
- "CreateTableEvent{tableId=%s.customers, schema=columns={`id`
INT NOT NULL,`name` VARCHAR(255) NOT NULL 'flink',`address`
VARCHAR(1024),`phone_number` VARCHAR(512)}, primaryKeys=id, options=()}",
- "CreateTableEvent{tableId=%s.products, schema=columns={`id`
INT NOT NULL,`name` VARCHAR(255) NOT NULL 'flink',`description`
VARCHAR(512),`weight` FLOAT,`enum_c` STRING 'red',`json_c` STRING,`point_c`
STRING}, primaryKeys=id, options=()}");
+ validateResult("");
Review Comment:
`validateResult("")` doesn't check anything...
##########
flink-cdc-runtime/src/main/java/org/apache/flink/cdc/runtime/operators/transform/PreTransformOperator.java:
##########
@@ -270,6 +273,24 @@ public void close() throws Exception {
@Override
public void processElement(StreamRecord<Event> element) throws Exception {
Event event = element.getValue();
+ if (event instanceof ChangeEvent) {
Review Comment:
If I understand correctly, after this change, MySQL source will always emit
`CreateTableEvent` based on current tables' schema, before sending any
`DataChangeEvent`s.
As `event instanceof ChangeEvent` (L294) is `true`, we will emit a
`CreateTableEvent` restored from `PreTransformOp`'s state.
But the following `event instanceof CreateTableEvent` is also `true`. Are we
accidentally emitting duplicate and inconsistent `CreateTableEvent`s to the
downstream?
--
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]