Skip to content

[Bug] [Sink Clickhouse] Cannot set null to non-nullable column #5569

@wellbin-li

Description

@wellbin-li

Search before asking

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

What happened

hive sink ck, exception: Cannot set null to non-nullable colum

SeaTunnel Version

v2.3.3

SeaTunnel Config

env {
  execution.parallelism = 1
  job.mode = "BATCH"
}

source {
  Hive {
    table_name = "hive_db.table1"
    sql = "select * from hive_db.table1"
    result_table_name = "res1"
    metastore_uri = "******:9083"
  }
}

transform {
}

sink {
  Clickhouse {
    host = "******:80"
    database = "ck_db"
    table = "table1_all"
    username = "user-clusters"
    password = "******"
  }
}

Running Command

./bin/start-seatunnel-spark-3-connector-v2.sh \
--master local[4] \
--deploy-mode client \
--config ./config/seatunnel.streaming.conf.template

Error Exception

Caused by: java.sql.SQLException: Cannot set null to non-nullable column #48 [last_order_creation_date_with_outbound String]
	at com.clickhouse.jdbc.SqlExceptionUtils.clientError(SqlExceptionUtils.java:73)
	at com.clickhouse.jdbc.internal.InputBasedPreparedStatement.addBatch(InputBasedPreparedStatement.java:328)
	at org.apache.seatunnel.connectors.seatunnel.clickhouse.sink.client.executor.FieldNamedPreparedStatement.addBatch(FieldNamedPreparedStatement.java:371)
	at org.apache.seatunnel.connectors.seatunnel.clickhouse.sink.client.executor.SimpleBatchStatementExecutor.addToBatch(SimpleBatchStatementExecutor.java:43)
	at org.apache.seatunnel.connectors.seatunnel.clickhouse.sink.client.executor.BufferedBatchStatementExecutor.executeBatch(BufferedBatchStatementExecutor.java:51)
	at org.apache.seatunnel.connectors.seatunnel.clickhouse.sink.client.ClickhouseSinkWriter.flush(ClickhouseSinkWriter.java:124)
	... 16 more

Zeta or Flink or Spark Version

Spark 3.2

Java or Scala Version

java8

Screenshots

image

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions