Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
KeXiangWang committed Jul 19, 2024
1 parent 167e938 commit 3ea9d5b
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
5 changes: 5 additions & 0 deletions e2e_test/source/cdc/cdc.check.slt
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,8 @@ select * from enum_to_varchar order by id;
----
1 happy
2 ok

query II
select * from orders order by id;
----
1 happy
17 changes: 17 additions & 0 deletions e2e_test/source/cdc/cdc.load.slt
Original file line number Diff line number Diff line change
Expand Up @@ -242,3 +242,20 @@ create table enum_to_varchar (
table.name = 'enum_table',
slot.name = 'enum_to_varchar'
);


statement ok
create table orders (
id int,
name varchar,
PRIMARY KEY (id)
) with (
connector = 'postgres-cdc',
hostname = '${PGHOST:localhost}',
port = '${PGPORT:5432}',
username = '${PGUSER:$USER}',
password = '${PGPASSWORD:}',
database.name = '${PGDATABASE:postgres}',
table.name = 'Order',
slot.name = 'orders'
);
10 changes: 10 additions & 0 deletions e2e_test/source/cdc/cdc.share_stream.slt
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,11 @@ CREATE TABLE person_new (
city varchar
) FROM pg_source TABLE 'person';

CREATE TABLE orders_shared (
id int PRIMARY KEY,
name varchar,
) FROM pg_source TABLE 'Orders';

statement ok
CREATE TABLE person_new (
id int,
Expand Down Expand Up @@ -491,3 +496,8 @@ select * from enum_to_varchar_shared order by id;
----
1 happy
2 ok

query II
select * from orders_shared order by id;
----
1 happy
6 changes: 6 additions & 0 deletions e2e_test/source/cdc/postgres_cdc.sql
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,9 @@ CREATE TABLE list_with_null(id int primary key, my_int int[], my_num numeric[],
INSERT INTO list_with_null VALUES (1, '{1,2,NULL}', '{1.1,inf,NULL}', '{1.1,inf,NULL}', '{1.1,inf,NULL}', '{happy,ok,NULL}', '{bb488f9b-330d-4012-b849-12adeb49e57e,bb488f9b-330d-4012-b849-12adeb49e57f, NULL}', '{\\x00,\\x01,NULL}');
INSERT INTO list_with_null VALUES (2, '{NULL,3,4}', '{2.2,0,NULL}' , '{2.2,0,NULL}', '{2.2,0,NULL}', '{happy,ok,sad}', '{2de296df-eda7-4202-a81f-1036100ef4f6,2977afbc-0b12-459c-a36f-f623fc9e9840}', '{\\x00,\\x01,\\x02}');
INSERT INTO list_with_null VALUES (5, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

CREATE TABLE "Orders" (
id int PRIMARY KEY,
name varchar,
);
INSERT INTO "Orders" VALUES (1, 'happy');

0 comments on commit 3ea9d5b

Please sign in to comment.