Skip to content

[Feature] Add support for AvroType enum for debezium format #4912

Description

@jsingh-yelp

Search before asking

  • I searched in the issues and found nothing similar.

Motivation

Hello team,

I would like to request support for the ENUM type in the Debezium format, which is currently supported in Avro. Reference for the Avro Enum type implementation: Schema.java.

Solution

Currently, Flink treats enums as STRING by default. More specifically, "Avro enums have limited support. Flink supports reading and writing enums but treats them as a STRING type. From Flink's perspective, enums are not distinguishable from the STRING type. You can't create an Avro schema from Flink that has an enum field." Source: Flink Serialization Docs.

To provide similar support in Paimon, I believe that modifying the code to handle enums just as STRING types could work. For example, adding the following case in the Debezium schema utils:

case ENUM:
case STRING:
       return DataTypes.STRING();

This change can be made in DebeziumSchemaUtils.java.

Thanks let me know if something is unclear in this request.

Anything else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions