Skip to content

[FLINK-38886] Introduce GenericRecordData and Internal / External converters in flink-cdc-common#4218

Merged
lvyanquan merged 4 commits into
apache:masterfrom
yuxiqian:FLINK-38886
Jan 23, 2026
Merged

[FLINK-38886] Introduce GenericRecordData and Internal / External converters in flink-cdc-common#4218
lvyanquan merged 4 commits into
apache:masterfrom
yuxiqian:FLINK-38886

Conversation

@yuxiqian
Copy link
Copy Markdown
Member

This closes FLINK-38886.

Currently, there's no portable way to construct a CDC RecordData without depending on heavy flink-cdc-runtime packages. Also BinaryRecordData is not easy to parse and inspect.

Providing such classes and converters between CDC Internal objects / classes and Java objects / classes would simplify connectors implementation.

@yuxiqian
Copy link
Copy Markdown
Member Author

yuxiqian commented Jan 12, 2026

Updated this PR to reflect newly introduced Variant type, PTAL. @lvyanquan

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces GenericRecordData and a set of converter classes to provide a portable way to construct and manipulate CDC RecordData without depending on heavy runtime packages. The converters facilitate bidirectional conversion between CDC internal objects and Java objects, simplifying connector implementation.

Changes:

  • Added GenericRecordData class for generic RecordData implementation backed by Object arrays
  • Introduced converter classes: CommonConverter, InternalObjectConverter, InternalClassConverter, JavaObjectConverter, and JavaClassConverter
  • Added VARIANT type support to SchemaMergingUtils and related tests
  • Created documentation for type mappings between CDC internal types and Java external types

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
GenericRecordData.java New generic RecordData implementation using Object array storage
GenericArrayData.java Added toString() method for better debugging support
CommonConverter.java Shared conversion logic between Java and internal objects
InternalObjectConverter.java Converts Java objects to CDC internal representations
InternalClassConverter.java Maps DataTypes to CDC internal class types
JavaObjectConverter.java Converts CDC internal objects to Java objects
JavaClassConverter.java Maps DataTypes to Java class types
SchemaMergingUtils.java Added VARIANT type coercion support
SchemaMergingUtilsTest.java Extended tests to include VARIANT type
InternalObjectConverterTest.java Test coverage for internal object conversions
InternalClassConverterTest.java Test coverage for internal class mappings
JavaObjectConverterTest.java Test coverage for Java object conversions
JavaClassConverterTest.java Test coverage for Java class mappings
VariantConvertingTest.java Test coverage for VARIANT type conversions
type-mappings.md (EN/ZH) Documentation for type mapping reference

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/content/docs/core-concept/type-mappings.md Outdated
Comment thread docs/content.zh/docs/core-concept/type-mappings.md Outdated
@yuxiqian yuxiqian closed this Jan 16, 2026
@yuxiqian yuxiqian reopened this Jan 16, 2026
Copy link
Copy Markdown
Contributor

@lvyanquan lvyanquan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1.

@lvyanquan lvyanquan merged commit 8421122 into apache:master Jan 23, 2026
41 of 44 checks passed
Mrart pushed a commit to Mrart/flink-cdc that referenced this pull request Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved common docs Improvements or additions to documentation reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants