allegro / allegro/json-avro-converter

field [fieldName] is expected to be one of these: RECORD, NULL, for nested record with non defined nullable values

Aperta
#9 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Groovy
Stelle
286
Fork
98
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

I got:
_Could not evaluate union, field [fieldName] is expected to be one of these: RECORD, NULL. If this is a complex type, check if offending field: trafficSource.adwordsClickInfo adheres to schema._
when I have nested records, where some of the 'nullable' fields are not specified.

schema sample:

```
{
"type": "record",
"name": "Root",
"fields": [
{
"name": "field1",
"type": [
"long",
"null"
]
},
{
"name": "nestedRecord",
"type": [
{
"type": "record",
"namespace": "root",
"name": "NestedRecord",
"fields": [
{
"name": "nested1",
"type": [
"long",
"null"
]
},
{
"name": "nested2",
"type": [
"long",
"null"
]
}
]
},
"null"
]
}
]
}
```

and json string such as:

```
{
"field1" : 10999859003,
"nestedRecord":
{
"nested1" : 123321321
}
}
```

I think when it goes in recursion it is not able to skip missing values because for those missing value at level 0 it skips the missing values.

Thank you

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.