Skip to content
This repository has been archived by the owner on Jun 30, 2023. It is now read-only.
This repository has been archived by the owner on Jun 30, 2023. It is now read-only.

Fields with same name and different type can cause issue for avro sink #42

Open
@abhishekagarwal87

Description

Assume a following simple protobuf schema

message NestedStruct_1 {
 optional int64 nestedField_1
}

message NestedStruct_2 {
 optional int64 nestedField_2
}

message Struct_1 {
 optional NestedStruct_1 nested = 1;
}

message Struct_2 {
 optional NestedStruct_2 nested = 1;
}

message Test {
   required Struct_1 struct1 = 1;
   required Struct_2 struct2 = 2;
}

Now, protobuf converter can read the data for Test.proto but if you try to write the this data in avro, sink, you will get an exception similar to follows
org.apache.avro.SchemaParseException: Can't redefine: nested

In the original schema, there are two fields with same name but different type. However, when building connect schema in ProtobufData, we lose the type scope and hence it results in conflicts in Avro sinks.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions