Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
KeXiangWang committed Sep 8, 2024
1 parent 52ce057 commit 689547f
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 2 deletions.
20 changes: 20 additions & 0 deletions e2e_test/source/cdc/cdc.check_new_rows.slt
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,16 @@ SELECT * FROM postgres_timestamptz_types ORDER BY c_boolean, c_int;
18 t 2025-01-08 18:30:00
19 t 2025-07-09 07:10:00

query TTT
SELECT * FROM postgres_timestamptz_types_2023 ORDER BY c_boolean, c_int;
----
1 f 2023-02-01 10:30:00
2 f 2023-05-15 11:45:00
3 f 2023-11-03 12:15:00
11 t 2023-02-01 10:30:00
12 t 2023-05-15 11:45:00
13 t 2023-11-03 12:15:00

query TTT
SELECT * FROM partitioned_timestamp_table_shared ORDER BY c_boolean, c_int;
----
Expand All @@ -365,3 +375,13 @@ SELECT * FROM partitioned_timestamp_table_shared ORDER BY c_boolean, c_int;
17 t 2024-09-07 16:45:00
18 t 2025-01-08 18:30:00
19 t 2025-07-09 07:10:00

query TTT
SELECT * FROM partitioned_timestamp_table_2023_shared ORDER BY c_boolean, c_int;
----
1 f 2023-02-01 10:30:00
2 f 2023-05-15 11:45:00
3 f 2023-11-03 12:15:00
11 t 2023-02-01 10:30:00
12 t 2023-05-15 11:45:00
13 t 2023-11-03 12:15:00
18 changes: 18 additions & 0 deletions e2e_test/source/cdc/cdc.load.slt
Original file line number Diff line number Diff line change
Expand Up @@ -275,4 +275,22 @@ WITH (
table.name = 'partitioned_timestamp_table',
publication.name = 'rw_publication'
slot.name = 'my_slot_partition'
);

statement ok
CREATE TABLE IF NOT EXISTS partitioned_timestamp_table_2023(
c_int int,
c_boolean boolean,
c_timestamp timestamp,
PRIMARY KEY (c_int, c_timestamp)
WITH (
hostname = '${PGHOST:localhost}',
port = '${PGPORT:5432}',
username = '${PGUSER:$USER}',
password = '${PGPASSWORD:}',
database.name = '${PGDATABASE:postgres}',
schema.name = 'public',
table.name = 'partitioned_timestamp_table_2023',
publication.name = 'rw_publication'
slot.name = 'my_slot_partition'
);
8 changes: 8 additions & 0 deletions e2e_test/source/cdc/cdc.share_stream.slt
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,14 @@ CREATE TABLE partitioned_timestamp_table_shared(
PRIMARY KEY (c_int, c_timestamp)
) from pg_source table 'public.partitioned_timestamp_table';

statement ok
CREATE TABLE partitioned_timestamp_table_2023_shared(
c_int int,
c_boolean boolean,
c_timestamp timestamp,
PRIMARY KEY (c_int, c_timestamp)
) from pg_source table 'public.partitioned_timestamp_table_2023_shared';

statement ok
create materialized view products_test_cnt as select count(*) as cnt from rw.products_test;

Expand Down
2 changes: 1 addition & 1 deletion e2e_test/source/cdc/postgres_cdc.sql
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ CREATE TABLE partitioned_timestamp_table_2024 PARTITION OF partitioned_timestamp
CREATE TABLE partitioned_timestamp_table_2025 PARTITION OF partitioned_timestamp_table
FOR VALUES FROM ('2025-01-01') TO ('2025-12-31');

INSERT INTO partitioned_timestamp_table (c_int, c_boolean, c_timestamp) VALUES
INSERT INTO partitioned_timestamp_table (c_int, c_boolean, c_timestamp) VALUES
(1, false, '2023-02-01 10:30:00'),
(2, false, '2023-05-15 11:45:00'),
(3, false, '2023-11-03 12:15:00'),
Expand Down
2 changes: 1 addition & 1 deletion e2e_test/source/cdc/postgres_cdc_insert.sql
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ INSERT INTO list_with_null VALUES (3, '{NULL,-3,-4}', '{NULL,nan,-inf}', '{NULL,
INSERT INTO list_with_null VALUES (4, '{-4,-5,-6}', '{NULL,-99999999999999999.9999}', '{NULL,-99999999999999999.9999}', '{NULL,-99999999999999999.9999}', '{NULL,sad,ok}', '{b2e4636d-fa03-4ad4-bf16-029a79dca3e2}', '{\\x88,\\x99,\\xAA}');
INSERT INTO list_with_null VALUES (6, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

INSERT INTO partitioned_timestamp_table (c_int, c_boolean, c_timestamp) VALUES
INSERT INTO partitioned_timestamp_table (c_int, c_boolean, c_timestamp) VALUES
(11, true, '2023-02-01 10:30:00'),
(12, true, '2023-05-15 11:45:00'),
(13, true, '2023-11-03 12:15:00'),
Expand Down

0 comments on commit 689547f

Please sign in to comment.