[
https://issues.apache.org/jira/browse/FLINK-36858?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Leonard Xu updated FLINK-36858:
-------------------------------
Fix Version/s: cdc-3.3.0
> [pipeline-kafka] JsonRowDataSerializationSchema compatibility bug
> -----------------------------------------------------------------
>
> Key: FLINK-36858
> URL: https://issues.apache.org/jira/browse/FLINK-36858
> Project: Flink
> Issue Type: Bug
> Components: Flink CDC
> Affects Versions: cdc-3.2.1
> Reporter: MOBIN
> Priority: Major
> Labels: pull-request-available
> Fix For: cdc-3.3.0
>
> Attachments: image-2024-12-06-15-20-02-727.png
>
>
> I encountered this bug when I was working on MysqlToKafkaE2eITCase
> minimum repetition step:
> Flink 1.20
> Flink cdc master
> {code:java}
> source:
> type: mysql
> name: MySQL Source
> hostname: localhost
> port: 3306
> username: test
> password: test
> tables: testDB.testTable
> server-id: 5206
> server-time-zone: Asia/Shanghai
> schema-change.enabled: true
>
> sink:
> type: kafka
> name: Kafka Sink
> properties.bootstrap.servers: localhost:9092
> topic: test_topic
> pipeline:
> name: MySQL to Kafka Pipeline
> parallelism: 1 {code}
> error message:
> {code:java}
> Caused by: java.lang.NoSuchMethodError: 'void
> org.apache.flink.formats.json.JsonRowDataSerializationSchema.<init>(org.apache.flink.table.types.logical.RowType,
> org.apache.flink.formats.common.TimestampFormat,
> org.apache.flink.formats.json.JsonFormatOptions$MapNullKeyMode,
> java.lang.String, boolean)'
> at
> org.apache.flink.cdc.connectors.kafka.serialization.JsonSerializationSchema.buildSerializationForPrimaryKey(JsonSerializationSchema.java:134)
> at
> org.apache.flink.cdc.connectors.kafka.serialization.JsonSerializationSchema.serialize(JsonSerializationSchema.java:101)
> at
> org.apache.flink.cdc.connectors.kafka.serialization.JsonSerializationSchema.serialize(JsonSerializationSchema.java:47)
> at
> org.apache.flink.cdc.connectors.kafka.sink.PipelineKafkaRecordSerializationSchema.serialize(PipelineKafkaRecordSerializationSchema.java:99)
> at
> org.apache.flink.cdc.connectors.kafka.sink.PipelineKafkaRecordSerializationSchema.serialize(PipelineKafkaRecordSerializationSchema.java:44)
> {code}
> Cause of error:
> The JsonRowDataSerializationSchema constructor of Flink 1.20 has an
> additional ignoreNullFields parameter, which causes this [part of the
> code|https://github.com/apache/flink-cdc/blob/ee9cd828c3ba822570cb349f7ce978234086aeb6/flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-kafka/src/main/java/org/apache/flink/cdc/connectors/kafka/serialization/JsonSerializationSchema.java#L134]
> to throw a NoSuchMethodError
> !image-2024-12-06-15-20-02-727.png|width=1315,height=364!
--
This message was sent by Atlassian Jira
(v8.20.10#820010)