11statement ok
2- create table t_remote (
2+ create table t_remote_0 (
33 id integer primary key,
44 v_varchar varchar,
55 v_smallint smallint,
@@ -12,59 +12,127 @@ create table t_remote (
1212);
1313
1414statement ok
15- create materialized view mv_remote as select * from t_remote;
15+ CREATE TABLE t_remote_1 (
16+ id BIGINT PRIMARY KEY,
17+ v_varchar VARCHAR,
18+ v_text TEXT,
19+ v_integer INTEGER,
20+ v_smallint SMALLINT,
21+ v_bigint BIGINT,
22+ v_decimal DECIMAL,
23+ v_real REAL,
24+ v_double DOUBLE PRECISION,
25+ v_boolean BOOLEAN,
26+ v_date DATE,
27+ v_time TIME,
28+ v_timestamp TIMESTAMP,
29+ v_jsonb JSONB,
30+ v_bytea BYTEA
31+ );
32+
33+ statement ok
34+ create materialized view mv_remote_0 as select * from t_remote_0;
35+
36+ statement ok
37+ create materialized view mv_remote_1 as select * from t_remote_1;
1638
1739statement ok
18- CREATE SINK s_postgres FROM mv_remote WITH (
40+ CREATE SINK s_postgres_0 FROM mv_remote_0 WITH (
1941 connector='jdbc',
2042 jdbc.url='jdbc:postgresql://db:5432/test?user=test&password=connector',
21- table.name='t_remote',
43+ table.name='t_remote_0',
44+ type='upsert'
45+ );
46+
47+ statement ok
48+ CREATE SINK s_postgres_1 FROM mv_remote_1 WITH (
49+ connector='jdbc',
50+ jdbc.url='jdbc:postgresql://db:5432/test?user=test&password=connector',
51+ table.name='t_remote_1',
52+ type='upsert'
53+ );
54+
55+ statement ok
56+ CREATE SINK s_mysql_0 FROM mv_remote_0 WITH (
57+ connector='jdbc',
58+ jdbc.url='jdbc:mysql://mysql:3306/test?user=mysqluser&password=mysqlpw',
59+ table.name='t_remote_0',
2260 type='upsert'
2361);
2462
2563statement ok
26- CREATE SINK s_mysql FROM mv_remote WITH (
64+ CREATE SINK s_mysql_1 FROM mv_remote_1 WITH (
2765 connector='jdbc',
2866 jdbc.url='jdbc:mysql://mysql:3306/test?user=mysqluser&password=mysqlpw',
29- table.name='t_remote ',
67+ table.name='t_remote_1 ',
3068 type='upsert'
3169);
3270
3371statement ok
34- INSERT INTO t_remote VALUES
72+ INSERT INTO t_remote_0 VALUES
3573 (1, 'Alice', 28208, 281620391, 4986480304337356659, 28162.0391, 2.03, 28162.0391, '2023-03-20 10:18:30'),
3674 (2, 'Bob', 10580, 2131030003, 3074255027698877876, 21310.30003, 10.3, 21310.30003, '2023-03-20 10:18:31'),
3775 (3, 'Carl', 18300, 1702307129, 7878292368468104216, 17023.07129, 23.07, 17023.07129, '2023-03-20 10:18:32');
3876
3977statement ok
40- INSERT INTO t_remote VALUES
78+ INSERT INTO t_remote_0 VALUES
4179 (4, 'Doris', 17250, 151951802, 3946135584462581863, 1519518.02, 18.02, 1519518.02, '2023-03-21 10:18:30'),
4280 (5, 'Eve', 9725, 698160808, 524334216698825611, 69.8160808, 69.81, 69.8160808, '2023-03-21 10:18:31'),
4381 (6, 'Frank', 28131, 1233587627, 8492820454814063326, 123358.7627, 58.76, 123358.7627, '2023-03-21 10:18:32');
4482
83+ statement ok
84+ INSERT INTO t_remote_1 VALUES
85+ (1, 'Varchar value 1', 'Text value 1', 123, 456, 789, 12.34, 56.78, 90.12, TRUE, '2023-05-22', '12:34:56', '2023-05-22 12:34:56', '{"key": "value"}', E'\\xDEADBEEF'),
86+ (2, 'Varchar value 2', 'Text value 2', 234, 567, 890, 23.45, 67.89, 01.23, FALSE, '2023-05-23', '23:45:01', '2023-05-23 23:45:01', '{"key": "value2"}', E'\\xFEEDBEEF'),
87+ (3, 'Varchar value 3', 'Text value 3', 345, 678, 901, 34.56, 78.90, 12.34, TRUE, '2023-05-24', '12:34:56', '2023-05-24 12:34:56', '{"key": "value3"}', E'\\xCAFEBABE');
88+
89+ statement ok
90+ INSERT INTO t_remote_1 VALUES
91+ (4, 'Varchar value 4', 'Text value 4', 456, 789, 012, 45.67, 89.01, 23.45, FALSE, '2023-05-25', '23:45:01', '2023-05-25 23:45:01', '{"key": "value4"}', E'\\xBABEC0DE'),
92+ (5, 'Varchar value 5', 'Text value 5', 567, 890, 123, 56.78, 90.12, 34.56, TRUE, '2023-05-26', '12:34:56', '2023-05-26 12:34:56', '{"key": "value5"}', E'\\xDEADBABE'),
93+ (6, 'Varchar value 6', 'Text value 6', 789, 123, 456, 67.89, 34.56, 78.91, FALSE, '2023-05-27', '23:45:01', '2023-05-27 23:45:01', '{"key": "value6"}', E'\\xDEADBABE');
94+
4595statement ok
4696FLUSH;
4797
4898statement ok
49- UPDATE t_remote SET v_varchar = 'Alex' WHERE id = 1;
99+ UPDATE t_remote_0 SET v_varchar = 'Alex' WHERE id = 1;
100+
101+ statement ok
102+ UPDATE t_remote_1 SET v_varchar = 'Alex' WHERE id = 1;
103+
104+ statement ok
105+ DELETE FROM t_remote_0 WHERE id = 2;
50106
51107statement ok
52- DELETE FROM t_remote WHERE id = 2;
108+ DELETE FROM t_remote_1 WHERE id = 2;
53109
54110statement ok
55111FLUSH;
56112
57113statement ok
58- DROP SINK s_postgres;
114+ DROP SINK s_postgres_0;
115+
116+ statement ok
117+ DROP SINK s_postgres_1;
118+
119+ statement ok
120+ DROP SINK s_mysql_0;
121+
122+ statement ok
123+ DROP SINK s_mysql_1;
124+
125+ statement ok
126+ DROP MATERIALIZED VIEW mv_remote_0;
59127
60128statement ok
61- DROP SINK s_mysql
129+ DROP MATERIALIZED VIEW mv_remote_1;
62130
63131statement ok
64- DROP MATERIALIZED VIEW mv_remote ;
132+ DROP TABLE t_remote_0 ;
65133
66134statement ok
67- DROP TABLE t_remote ;
135+ DROP TABLE t_remote_1 ;
68136
69137statement ok
70138FLUSH;
0 commit comments