[FLINK-39417] Fix GenericRecordData could not be [de]serialized in pipeline#4374
Open
yuxiqian wants to merge 9 commits intoapache:masterfrom
Open
[FLINK-39417] Fix GenericRecordData could not be [de]serialized in pipeline#4374yuxiqian wants to merge 9 commits intoapache:masterfrom
yuxiqian wants to merge 9 commits intoapache:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses FLINK-39417 by enabling end-to-end (de)serialization of GenericRecordData in Flink CDC pipelines, complementing the earlier introduction of GenericRecordData as a binary-unaware RecordData implementation.
Changes:
- Extend
RecordDataSerializerto support bothBinaryRecordDataandGenericRecordData. - Introduce a new self-describing
GenericRecordDataSerializer(type-tagged field encoding). - Broaden runtime/operator/test coverage to exercise
GenericRecordDatathrough transforms and Values connector pipelines.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| flink-cdc-runtime/src/test/java/org/apache/flink/cdc/runtime/serializer/data/RecordDataSerializerTest.java | Adds unit tests covering serialization/copy for GenericRecordData and nested structures. |
| flink-cdc-runtime/src/main/java/org/apache/flink/cdc/runtime/serializer/data/writer/BinaryWriter.java | Converts non-binary RecordData rows to BinaryRecordData when writing ROW fields. |
| flink-cdc-runtime/src/main/java/org/apache/flink/cdc/runtime/serializer/data/RecordDataSerializer.java | Adds a type-tagged wrapper format to serialize BinaryRecordData vs GenericRecordData. |
| flink-cdc-runtime/src/main/java/org/apache/flink/cdc/runtime/serializer/data/GenericRecordDataSerializer.java | New self-describing serializer for GenericRecordData fields (incl. nested rows/array/map/variant). |
| flink-cdc-runtime/src/main/java/org/apache/flink/cdc/runtime/operators/transform/PreTransformProcessor.java | Accepts RecordData input to allow pre-transform projection for generic rows. |
| flink-cdc-runtime/src/main/java/org/apache/flink/cdc/runtime/operators/transform/PreTransformOperator.java | Stops casting change-event before/after to BinaryRecordData, enabling generic rows. |
| flink-cdc-connect/.../ValuesDatabase.java | Builds PK strings via FieldGetter to support non-string PK types and non-binary records. |
| flink-cdc-composer/src/test/java/.../FlinkPipelineComposerITCase.java | Adds an IT case that runs GenericRecordData end-to-end across many types incl. array/map/row. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...runtime/src/main/java/org/apache/flink/cdc/runtime/serializer/data/RecordDataSerializer.java
Show resolved
Hide resolved
...-runtime/src/main/java/org/apache/flink/cdc/runtime/serializer/data/writer/BinaryWriter.java
Show resolved
Hide resolved
.../src/main/java/org/apache/flink/cdc/runtime/serializer/data/GenericRecordDataSerializer.java
Show resolved
Hide resolved
.../src/main/java/org/apache/flink/cdc/runtime/serializer/data/GenericRecordDataSerializer.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/apache/flink/cdc/runtime/serializer/data/GenericRecordDataSerializer.java
Show resolved
Hide resolved
.../src/main/java/org/apache/flink/cdc/runtime/serializer/data/GenericRecordDataSerializer.java
Show resolved
Hide resolved
.../src/main/java/org/apache/flink/cdc/runtime/serializer/data/GenericRecordDataSerializer.java
Show resolved
Hide resolved
wenshao
reviewed
Apr 12, 2026
.../src/main/java/org/apache/flink/cdc/runtime/serializer/data/GenericRecordDataSerializer.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/apache/flink/cdc/runtime/serializer/data/GenericRecordDataSerializer.java
Show resolved
Hide resolved
...-runtime/src/main/java/org/apache/flink/cdc/runtime/serializer/data/writer/BinaryWriter.java
Show resolved
Hide resolved
...runtime/src/main/java/org/apache/flink/cdc/runtime/serializer/data/RecordDataSerializer.java
Outdated
Show resolved
Hide resolved
...ime/src/test/java/org/apache/flink/cdc/runtime/serializer/data/RecordDataSerializerTest.java
Show resolved
Hide resolved
...ime/src/test/java/org/apache/flink/cdc/runtime/serializer/data/RecordDataSerializerTest.java
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This closes FLINK-39417.
Previously in FLINK-38886, we introduced a GenericRecordData as a replacement of BinaryRecordData so connector and internal operator developers could get rid of the heavy
flink-cdc-runtimeoperator and construct binary-unaware records.However, lacking corresponding serializers, it could not be used in complete pipelines but only in specific test cases.