Skip to content

Conversation

@lvyanquan
Copy link
Contributor

@lvyanquan lvyanquan commented Jan 20, 2026

Add support for creating and writing table with variant type.

Why not add end-to-end (e2e) tests?
Because the Flink version we're currently using is 1.20, and Flink SQL in this version does not yet support querying the VARIANT type. Therefore, we cannot use the catalog in Flink SQL to query and verify the results.
Support for this will only be available after we upgrade to Flink 2.2.

@lvyanquan
Copy link
Contributor Author

Hi @yunfengzhou-hub, maybe you can help to review this as you are more familiar with Paimon Sink.

Copy link

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 pull request adds support for creating and writing tables with the VARIANT data type in the Paimon connector for Flink CDC.

Changes:

  • Introduced a new TypeUtils utility class to handle type conversions between CDC and Paimon systems with special handling for VARIANT types
  • Added field getter implementation for VARIANT type in PaimonWriterHelper to convert between CDC's BinaryVariant and Paimon's GenericVariant
  • Refactored existing type conversion code to use the new TypeUtils class for consistency and to support VARIANT type

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
TypeUtils.java New utility class providing bidirectional type conversion between CDC and Paimon types with special handling for VARIANT
PaimonWriterHelper.java Added VARIANT field getter and updated schema deduction to use TypeUtils for type conversions
SchemaChangeProvider.java Refactored to use TypeUtils for consistent type conversion, eliminating duplicated conversion logic
PaimonMetadataApplier.java Refactored to use TypeUtils for type conversion when applying schema changes
PaimonWriterHelperTest.java Added comprehensive tests for VARIANT type handling in data conversion and schema deduction
PaimonMetadataApplierTest.java Added tests for creating tables and adding columns with VARIANT type
PaimonHashFunctionTest.java Added VARIANT type to hash function tests to ensure proper handling in partitioning logic

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

Copy link

@yunfengzhou-hub yunfengzhou-hub left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. Left some comments as below.

Copy link

@yunfengzhou-hub yunfengzhou-hub 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 7d9e1c6 into apache:master Jan 21, 2026
37 of 43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants