Skip to content

Fields in Kafka topic with a Union of record only render the uppermost field in the UI #24743

@Jezreel-Zamora-Paidy

Description

@Jezreel-Zamora-Paidy

Affected module
UI
Describe the bug
Fields with a Union of Types in Kafka Topic are not rendered properly in the UI and only show the uppermost field. We can still see the structure if we click on the text field but if the problem is that if you check the version history of the topic, you will not be able to see the actual change on the field because it only show the topmost field.

To Reproduce

{
  "type": "record",
  "name": "ChangeEvent",
  "namespace": "xxxx",
  "fields": [
    {
      "name": "event",
      "type": [
        {
          "type": "record",
          "name": "change1",
          "fields": [
            {
              "name": "id",
              "type": "string"
            },
            {
              "name": "firstName",
              "type": "string"
            }
          ]
        },
        {
          "type": "record",
          "name": "change2",
          "fields": [
            {
              "name": "id",
              "type": "string"
            },
            {
              "name": "address",
              "type": "string"
            }
          ]
        }
      ]
    }
  ]
}

The above avro schema will render the field in the UI like
event - `Union<record,record,record>

Screenshots or steps to reproduce

Image

Expected behavior
Kafka topic Union of record field is fully rendered in the field tab in the Openmetadata UI

Version:

  • OS: [e.g. iOS]
  • Python version: 3.11.4
  • OpenMetadata version: 1.9.13
  • OpenMetadata Ingestion package version:openmetadata-ingestion[kafka]==1.9.13

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions