Skip to content

[Bug] [connector-jdbc] Nullable Column source have null data could be unexpected results. #5559

@mosence

Description

@mosence

Search before asking

  • I had searched in the issues and found no similar issues.

What happened

create table s_a
(
c_int int null,
c_long mediumtext null,
c_short smallint null,
c_byte tinyint null,
c_decimal decimal null,
c_float float null,
c_double double null,
c_boolean tinyint(1) null,
c_date date null,
c_time time null,
c_datetime datetime null,
c_timestamp timestamp null
);

create table t_a
(
c_int int null,
c_long mediumtext null,
c_short smallint null,
c_byte tinyint null,
c_decimal decimal null,
c_float float null,
c_double double null,
c_boolean tinyint(1) null,
c_date date null,
c_time time null,
c_datetime datetime null,
c_timestamp timestamp null
);

s_a 's data like this:

image

SeaTunnel Version

dev

SeaTunnel Config

env {
  checkpoint.interval = 300000
  parallelism = 1
  job.mode = "BATCH"
}
source {
  jdbc {
    url = "jdbc:mysql://localhost:3306/db?useSsl=false"
    driver = "com.mysql.cj.jdbc.Driver"
    user = "app"
    password = "password"
    query = "select c_int,c_long,c_short,c_byte,c_decimal,c_float,c_double,c_boolean,c_date,c_time,c_datetime,c_timestamp from s_a"
    result_table_name = "sourceTable"
  }
}
sink {
  jdbc {
    source_table_name = "sourceTable"
    url = "jdbc:mysql://localhost:3306/db?useSsl=false"
    driver = "com.mysql.cj.jdbc.Driver"
    user = "user"
    password = "password"
    query = "insert into t_a(c_int,c_long,c_short,c_byte,c_decimal,c_float,c_double,c_boolean,c_date,c_time,c_datetime,c_timestamp) values (?,?,?,?,?,?,?,?,?,?,?,?);"
  }
}

Running Command

./bin/seatunnel.sh -c config.conf -e local

Error Exception

No exception. But data unexpected results. See Screenshots.

Zeta or Flink or Spark Version

Zeta

Java or Scala Version

Java 1.8

Screenshots

1695713776582

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions