Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-3104

Nested schema for JSON fields

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Unresolved
    • Icon: Major Major
    • Backlog
    • None
    • examples
    • None
    • False
    • False
    • Undefined

      At the moment, it seems like the JSON fields are considered as a string in the generated Avro or JSON schema.

      Current generated schema

       

      {
        "type": "record",
        "name": "Value",
        "namespace": "{...}",
        "fields": [
          {
            "name": "id",
            "type": "string"
          },
          {
            "name": "a_uuid_reference",
            "type": {
              "type": "string",
              "connect.version": 1,
              "connect.name": "io.debezium.data.Uuid"
            }
          },
          {
            "name": "a_json_field",
            "type": {
              "type": "string",
              "connect.version": 1,
              "connect.name": "io.debezium.data.Json"
            }
          },
          // ...
        ],
        "connect.name": "{...}"
      }

       

      Expected generated schema

      Instead of the `string` type for the `a_json_field`, I'd like it to contain the nested structure of what the field contains.

      Connector configuration

      plugin.name: pgoutput
      # [...]
      
      table.include.list: public.my_table_name
      transforms: unwrap
      transforms.unwrap.type: io.debezium.transforms.ExtractNewRecordState 
      
      key.converter: io.apicurio.registry.utils.converter.AvroConverter
      key.converter.apicurio.registry.url: http://apicurio-registry.kafka.svc.cluster.local/api
      key.converter.apicurio.registry.global-id: io.apicurio.registry.utils.serde.strategy.GetOrCreateIdStrategy
      value.converter: io.apicurio.registry.utils.converter.AvroConverter
      value.converter.apicurio.registry.url: http://apicurio-registry.kafka.svc.cluster.local/api
      value.converter.apicurio.registry.global-id: io.apicurio.registry.utils.serde.strategy.GetOrCreateIdStrategy

       
      Did I miss something or is it a requested feature?

              Unassigned Unassigned
              sroze Samuel ROZE (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: