Hello,

  I am observing class cast exceptions while building a generic record that
has
  Map values of record types. The map value schema itself is nested and the
record
  type for the map value can be either a record or a string, with the
latter record
  being again a record that has a schema.

  Is this something that has been tested/used via a generic record?

   Attaching schema with which I observe exceptions while encoding the
built record.

Thanks
Sameer
{
    "name": "rec1",
    "type": "record",
    "fields": [
        {
            "name": "requests",
            "default": [],
            "type": {
                "type": "array",
                "items": {"type": "map", "values": "string"}
            }
        },
        {
            "name": "arguments",
            "default": {
                "arguments": "{}"
            },
            "type": {
                "type": "map",
                "values": "string"
            }
        },
        {
            "name": "context",
            "default": {
                "context": "{}"
            },
            "type": {
                "type": "map",
                "values": "string"
            }
        },
        {
            "name": "kvm",
            "default": {
                "kvm": "{}"
            },
            "type": {
                "type": "map",
                "values": "string"
            }
        },
        {
            "name": "properties",
            "default": {
                "properties": "{}"
            },
            "type": {
                "type": "map",
                "values": "string"
            }
        },
        {
            "name": "ud",
            "default": {
                "data": {
                    "pr": {
                        "data": [
                            1,
                            2
                        ],
                        "type": "ListInt"
                    }
                }
            },
            "type": {
                "type": "map",
                "values": {
                    "name": "udvalues",
                    "type": "record",
                    "fields": [
                        {
                            "name": "data",
                            "default" : { "pr": { "data": [ 1, 2 ], "type": 
"ListInt" } },
                            "type": {
                                "type": "map",
                                "values": {
                                    "name": "datavalues",
                                    "type": "record",
                                    "fields": [
                                        {
                                            "name": "pr",
                                            "default" : { "data": [ 1, 2 ], 
"type": "ListInt" },
                                            "type": {
                                                "type": "map",
                                                "values": {
                                                    "name": "pr",
                                                    "type": "record",
                                                    "fields": [
                                                        {
                                                            "name": "data",
                                                             "default" : [1, 2],
                                                            "type": {
                                                                "type": "array",
                                                                "items": "int"
                                                            }
                                                        },
                                                        {
                                                            "name": "type",
                                                             "default" : 
"ListInt",
                                                            "type": "string"
                                                        }
                                                    ]
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        },
                        {
                            "name": "type",
                            "default": "MapStringUD",
                            "type": "string"
                        }
                    ]
                }
            }
        }
    ]
}

Reply via email to