Skip to content

Commit

Permalink
test(sink): add tidb-sink compatible test (#16177)
Browse files Browse the repository at this point in the history
  • Loading branch information
xuefengze authored and yezizp2012 committed Apr 7, 2024
1 parent 57d22be commit d1997b8
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 2 deletions.
9 changes: 9 additions & 0 deletions integration_tests/tidb-cdc-sink/create_sink.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,12 @@ WITH (
type='upsert',
primary_key='window_start,hashtag'
);

CREATE SINK tidb_sink_datatypes_sink FROM tidb_sink_datatypes
WITH (
connector='jdbc',
jdbc.url='jdbc:mysql://tidb:4000/test?user=root&password=',
table.name='tidb_sink_datatypes',
type='upsert',
primary_key='id'
);
36 changes: 36 additions & 0 deletions integration_tests/tidb-cdc-sink/create_source.sql

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions integration_tests/tidb-cdc-sink/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,15 @@ services:
# Adapted from https://github.com/confluentinc/demo-scene/blob/master/connect-jdbc/docker-compose.yml
zookeeper:
image: confluentinc/cp-zookeeper:5.5.1
platform: linux/amd64
container_name: zookeeper
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000

kafka:
image: confluentinc/cp-enterprise-kafka:5.5.1
platform: linux/amd64
container_name: kafka
depends_on:
- "zookeeper"
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/tidb-cdc-sink/sink_check.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sys
import subprocess

relations = ['hot_hashtags']
relations = ['hot_hashtags', 'tidb_sink_datatypes']

failed_cases = []
for rel in relations:
Expand Down
32 changes: 31 additions & 1 deletion integration_tests/tidb-cdc-sink/tidb_create_tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,34 @@ create table datatype (
`c18_text` text,
`c19_json` json,
PRIMARY KEY (`id`)
);
);

CREATE TABLE tidb_sink_datatypes (
id integer PRIMARY KEY,
c_boolean boolean,
c_tinyint tinyint,
c_smallint smallint,
c_mediumint mediumint,
c_integer integer,
c_bigint bigint,
c_decimal decimal,
c_float float,
c_double double,
c_char_255 char(255),
c_varchar_10000 varchar(10000),
c_text text,
c_blob BLOB,
c_binary_255 binary(255),
c_varbinary_10000 varbinary(10000),
c_date date,
c_time time(6),
c_datetime datetime(6),
c_timestamp timestamp(6),
c_json JSON,
c_smallint_array LONGTEXT,
c_integer_array LONGTEXT,
c_bigint_array LONGTEXT,
c_real_array LONGTEXT,
c_double_precision_array LONGTEXT,
c_varchar_array LONGTEXT
);

0 comments on commit d1997b8

Please sign in to comment.