[
https://issues.apache.org/jira/browse/FLINK-39757?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Mao Jiayi reopened FLINK-39757:
-------------------------------
> Fix kafka sink could not serialize debezium json with column default values
> ---------------------------------------------------------------------------
>
> Key: FLINK-39757
> URL: https://issues.apache.org/jira/browse/FLINK-39757
> Project: Flink
> Issue Type: Bug
> Components: Flink CDC
> Reporter: Mao Jiayi
> Priority: Major
> Labels: pull-request-available
>
> When using Kafka sink with Debezium JSON format, the serialization may fail
> if columns have non-string default values defined in the schema.
> The failure happens in {{*DebeziumJsonSerializationSchema*}} when building
> the Debezium schema. The previous implementation directly sets the default
> value expression string to the Debezium schema field without type conversion.
> When *Debezium's {{JsonConverter}}* processes the schema, it validates that
> the default value matches the field's schema type. If there is a type
> mismatch, it throws an error and the serialization fails.
> This issue is usually not exposed in simple schemas where all columns use
> string types or have no default values. In various source connectors, column
> metadata may include default value expressions as strings. When these schemas
> are serialized to Debezium JSON format for Kafka sink, the string default
> values must be converted to their corresponding Java types to match the
> Debezium schema type requirements. However, the current implementation does
> not perform this conversion.
> This issue is not specific to any particular source connector. It affects any
> pipeline that uses *Kafka sink with Debezium JSON format* when the source
> schema contains columns with non-string default value expressions.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)