Copilot commented on code in PR #4181:
URL: https://github.com/apache/flink-cdc/pull/4181#discussion_r2964996926
##########
flink-cdc-e2e-tests/flink-cdc-pipeline-e2e-tests/src/test/java/org/apache/flink/cdc/pipeline/tests/PostgresE2eITCase.java:
##########
@@ -142,16 +142,16 @@ void testSyncWholeDatabase() throws Exception {
"DataChangeEvent{tableId=%s.customers, before=[], after=[103,
Edward, Walker, [email protected]], op=INSERT, meta=()}",
"DataChangeEvent{tableId=%s.customers, before=[], after=[102,
George, Bailey, [email protected]], op=INSERT, meta=()}",
"DataChangeEvent{tableId=%s.customers, before=[], after=[101,
Sally, Thomas, [email protected]], op=INSERT, meta=()}",
- "CreateTableEvent{tableId=%s.products, schema=columns={`id`
INT NOT NULL 'nextval('inventory.products_id_seq'::regclass)',`name`
VARCHAR(255) NOT NULL,`description` VARCHAR(512),`weight` FLOAT},
primaryKeys=id, options=()}",
- "DataChangeEvent{tableId=%s.products, before=[], after=[109,
spare tire, 24 inch spare tire, 22.2], op=INSERT, meta=()}",
- "DataChangeEvent{tableId=%s.products, before=[], after=[107,
rocks, box of assorted rocks, 5.3], op=INSERT, meta=()}",
- "DataChangeEvent{tableId=%s.products, before=[], after=[108,
jacket, water resistent black wind breaker, 0.1], op=INSERT, meta=()}",
- "DataChangeEvent{tableId=%s.products, before=[], after=[105,
hammer, 14oz carpenter's hammer, 0.875], op=INSERT, meta=()}",
- "DataChangeEvent{tableId=%s.products, before=[], after=[106,
hammer, 16oz carpenter's hammer, 1.0], op=INSERT, meta=()}",
- "DataChangeEvent{tableId=%s.products, before=[], after=[103,
12-pack drill bits, 12-pack of drill bits with sizes ranging from #40 to #3,
0.8], op=INSERT, meta=()}",
- "DataChangeEvent{tableId=%s.products, before=[], after=[104,
hammer, 12oz carpenter's hammer, 0.75], op=INSERT, meta=()}",
- "DataChangeEvent{tableId=%s.products, before=[], after=[101,
scooter, Small 2-wheel scooter, 3.14], op=INSERT, meta=()}",
- "DataChangeEvent{tableId=%s.products, before=[], after=[102,
car battery, 12V car battery, 8.1], op=INSERT, meta=()}");
+ "CreateTableEvent{tableId=%s.products, schema=columns={`id`
INT NOT NULL 'nextval('inventory.products_id_seq'::regclass)',`name`
VARCHAR(255) NOT NULL,`description` VARCHAR(512),`weight` FLOAT,`created_at`
TIMESTAMP_LTZ(6)}, primaryKeys=id, options=()}",
+ "DataChangeEvent{tableId=%s.products, before=[], after=[109,
spare tire, 24 inch spare tire, 22.2, 2024-01-09T18:00], op=INSERT, meta=()}",
+ "DataChangeEvent{tableId=%s.products, before=[], after=[107,
rocks, box of assorted rocks, 5.3, 2024-01-07T16:45], op=INSERT, meta=()}",
+ "DataChangeEvent{tableId=%s.products, before=[], after=[108,
jacket, water resistent black wind breaker, 0.1, 2024-01-08T17:00], op=INSERT,
meta=()}",
Review Comment:
Typo in expected event payload: "water resistent" → "water resistant"
(should match the corrected test seed data in postgres_inventory.sql).
```suggestion
"DataChangeEvent{tableId=%s.products, before=[], after=[108,
jacket, water resistant black wind breaker, 0.1, 2024-01-08T17:00], op=INSERT,
meta=()}",
```
##########
flink-cdc-e2e-tests/flink-cdc-pipeline-e2e-tests/src/test/resources/ddl/postgres_inventory.sql:
##########
@@ -23,21 +23,22 @@ CREATE TABLE products (
id SERIAL NOT NULL PRIMARY KEY,
name VARCHAR(255) NOT NULL,
description VARCHAR(512),
- weight FLOAT(24)
+ weight FLOAT(24),
+ created_at TIMESTAMPTZ
);
ALTER SEQUENCE products_id_seq RESTART WITH 101;
ALTER TABLE products REPLICA IDENTITY FULL;
INSERT INTO products
-VALUES (default,'scooter','Small 2-wheel scooter',3.14),
- (default,'car battery','12V car battery',8.1),
- (default,'12-pack drill bits','12-pack of drill bits with sizes ranging
from #40 to #3',0.8),
- (default,'hammer','12oz carpenter''s hammer',0.75),
- (default,'hammer','14oz carpenter''s hammer',0.875),
- (default,'hammer','16oz carpenter''s hammer',1.0),
- (default,'rocks','box of assorted rocks',5.3),
- (default,'jacket','water resistent black wind breaker',0.1),
- (default,'spare tire','24 inch spare tire',22.2);
+VALUES (default,'scooter','Small 2-wheel scooter',3.14,'2024-01-01
10:00:00+00'),
+ (default,'car battery','12V car battery',8.1,'2024-01-02 11:30:00+00'),
+ (default,'12-pack drill bits','12-pack of drill bits with sizes ranging
from #40 to #3',0.8,'2024-01-03 12:00:00+00'),
+ (default,'hammer','12oz carpenter''s hammer',0.75,'2024-01-04
13:15:00+00'),
+ (default,'hammer','14oz carpenter''s hammer',0.875,'2024-01-05
14:20:00+00'),
+ (default,'hammer','16oz carpenter''s hammer',1.0,'2024-01-06
15:30:00+00'),
+ (default,'rocks','box of assorted rocks',5.3,'2024-01-07 16:45:00+00'),
+ (default,'jacket','water resistent black wind breaker',0.1,'2024-01-08
17:00:00+00'),
Review Comment:
Typo in inserted product description: "water resistent" → "water resistant".
Fixing this will also require updating the corresponding expected strings in
the E2E test.
```suggestion
(default,'jacket','water resistant black wind
breaker',0.1,'2024-01-08 17:00:00+00'),
```
##########
flink-cdc-e2e-tests/flink-cdc-pipeline-e2e-tests/src/test/resources/ddl/postgres_inventory.sql:
##########
@@ -23,21 +23,22 @@ CREATE TABLE products (
id SERIAL NOT NULL PRIMARY KEY,
name VARCHAR(255) NOT NULL,
description VARCHAR(512),
- weight FLOAT(24)
+ weight FLOAT(24),
+ created_at TIMESTAMPTZ
);
ALTER SEQUENCE products_id_seq RESTART WITH 101;
ALTER TABLE products REPLICA IDENTITY FULL;
INSERT INTO products
Review Comment:
For test data robustness, consider specifying the target column list in this
INSERT (e.g., include `created_at`). Right now it relies on the table's column
order, which makes the DDL fragile when columns are added/reordered (as
happened in this change).
```suggestion
INSERT INTO products (id, name, description, weight, created_at)
```
--
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]