Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
st1page committed Apr 28, 2024
1 parent d354ebf commit 7ac0aa0
Showing 1 changed file with 33 additions and 5 deletions.
38 changes: 33 additions & 5 deletions e2e_test/source/cdc/cdc.validate.postgres.slt
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,27 @@ create table shipments (
slot.name = 'shipments'
);

# format & encode provided but mismatch with debezium json, this is not allowed
statement error Row format for CDC connectors should be either omitted or set to `FORMAT DEBEZIUM ENCODE JSON`
create table shipments (
shipment_id INTEGER,
order_id real,
origin STRING,
destination STRING,
is_arrived boolean,
PRIMARY KEY (shipment_id)
) with (
connector = 'postgres-cdc',
hostname = 'db',
port = '5432',
username = 'postgres',
password = 'postgres',
database.name = 'cdc_test',
schema.name = 'public',
table.name = 'shipments',
slot.name = 'shipments'
) format canal encode csv;

# format & encode provided and match with debezium json, this is okay
statement ok
explain create table shipments (
Expand All @@ -147,14 +168,18 @@ explain create table shipments (
slot.name = 'shipments'
) format debezium encode json;

# format & encode provided but mismatch with debezium json, this is not allowed
statement error Row format for CDC connectors should be either omitted or set to `FORMAT DEBEZIUM ENCODE JSON`
create table shipments (
statement ok
drop table shipments;

# generated column
statement ok
explain create table shipments (
shipment_id INTEGER,
order_id real,
order_id INTEGER,
origin STRING,
destination STRING,
is_arrived boolean,
generated_c INGEGER AS shipment_id + order_id,
PRIMARY KEY (shipment_id)
) with (
connector = 'postgres-cdc',
Expand All @@ -166,7 +191,10 @@ create table shipments (
schema.name = 'public',
table.name = 'shipments',
slot.name = 'shipments'
) format canal encode csv;
);

statement ok
drop table shipments;

statement ok
explain create table numeric_to_rw_int256 (
Expand Down

0 comments on commit 7ac0aa0

Please sign in to comment.