microsoft / kafka-connect-cosmosdb

Kafka Connect connectors for Azure Cosmos DB
MIT License
51 stars 55 forks source link

CosmosDb Sink Connector appends `_0` to key of protobuf `oneOf` object #484

Open AlexKDawson opened 2 years ago

AlexKDawson commented 2 years ago

Description

Expected Behavior

Reproduce

  config_nonsensitive = {
    "connector.class" : "CosmosDbSink",
    "kafka.auth.mode" : "SERVICE_ACCOUNT",
    "kafka.service.account.id" : var.SA_CONNECTOR_ID,
    "tasks.max" : "1",

    "name" : "CosmosDbSink_namespace-project-tripintegrations-dev",
    "input.data.format" : "PROTOBUF",

    "topics" : "namespace-project-tripintegrations-byvehicle-dev-public",
    "connect.cosmos.databasename" : "Project.Demand",
    "connect.cosmos.containers.topicmap" : "namespace-project-tripintegrations-dev-public#TripStates",
    "cosmos.id.strategy" : "ProvidedInValueStrategy",

    "transforms" : "idTransform",
    "transforms.idTransform.type" : "org.apache.kafka.connect.transforms.ReplaceField$Value",
    "transforms.idTransform.renames" : "TripId:id",
  }
...
    "Origin": {
        "LocationDetail_0": {                                 <------------- The issue occurs here
            "LocationCode": "ABCDE",
            "Address": null
        },
        "IsCarvanaLocation": true
    },
    "Destination": {
        "LocationDetail_0": {                                 <------------- And here
            "LocationCode": "FGHIJ",
            "Address": null
        },
        "IsCarvanaLocation": true
    },
 ...

Additional Context

kushagraThapar commented 2 years ago

@xinlian12 please take a look.

AlexKDawson commented 2 years ago

Has there been any movement on this? Has this been reproducible?

xinlian12 commented 2 years ago

@AlexKDawson this issue is in our backlog, plant o pick it up in the next few weeks

AlexKDawson commented 2 years ago

Thanks for the update!