Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] streaming mode with TiKV sink fail with int type column #223

Closed
shiyuhang0 opened this issue Jun 23, 2022 · 0 comments · Fixed by #224
Closed

[BUG] streaming mode with TiKV sink fail with int type column #223

shiyuhang0 opened this issue Jun 23, 2022 · 0 comments · Fixed by #224
Labels
type/bug Something isn't working

Comments

@shiyuhang0
Copy link
Collaborator

shiyuhang0 commented Jun 23, 2022

Describe the bug

  • TiBigData: master
  • streaming mode, tikv sink

TiKV sink fails to convert Flink row to TiDB row when the table contains any one of the following types column

  • int
  • bit
  • tinyint
  • smallint
  • mediumint
  • year

What did you do

  1. create table
CREATE TABLE `test`.`t_src`  (
  `id` int(11) NOT NULL,
  `name` varchar(255) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) 
) ;

CREATE TABLE `test`.`t_dst`  (
  `id` int(11) NOT NULL,
  `name` varchar(255) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) 
) ;
  1. Use Kafka source get change log from TiCDC
  2. create catalog in sql-client
CREATE CATALOG `tidb` WITH (   'type' = 'tidb',   'tidb.database.url' = 'jdbc:mysql://127.0.0.1:4000?useSSL=false',   'tidb.username' = 'root',   'tidb.password' = '',   'tidb.streaming.source' = 'kafka',   'tidb.streaming.codec' = 'json',   'tidb.streaming.kafka.bootstrap.servers' = 'localhost:9092',   'tidb.streaming.kafka.topic' = 'cdc',   'tidb.streaming.kafka.group.id' = 'test_cdc_group',   'tidb.streaming.ignore-parse-errors' = 'true' ,'tidb.sink.impl'='TIKV')
  1. execute SQL in flink sql-client
INSERT INTO `tidb`.`test`.`t_dst` SELECT id,name FROM `tidb`.`test`.`t_src`
  1. Use JDBC to insert data into flink_sink
INSERT into test.flink_sink VALUES (1,1)
  1. you will find the ClassCastException is thrown

Screenshots
image

@shiyuhang0 shiyuhang0 added the type/bug Something isn't working label Jun 23, 2022
@shiyuhang0 shiyuhang0 changed the title [BUG] int pk fail in streaming mode with TiKV sink [BUG] streaming mode with TiKV sink fail with int type column Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant