Вход
{
"item" : "some value",
"get" : :some other value",
"org"{
"animal-type": ["mammal","reptile","bird"],
"animal-name": ["rat","pigeon"],
"some-random": ["one array"]
....
....any number of items with any name can show up here..
....
....
},
"some_weight" : "yuad asf-do-not-convet"
}
Выход
{
"item" : "some value",
"get" : :some other value",
....
Array of "org"
....
.... any format with "-" converted to "_" AND any representation in such a way that the number of elements in it is a fixed number
.... This one has ultimately to be converted into avro schema and we don't want to update schemas when occasional items appear within "org"
....
"some_weight" : "yuad asf-do-not-convet"
}
Толчок, который я пытался до сих пор,
[
{
"operation": "shift",
"spec": {
"org": {
"*-*-*": "&(0,1)_&(0,2)_&(0,3)",
"*-*": "&(0,1)_&(0,2)",
"*": "&"
},
"*": "&"
}
}
]
Это заменяет - на _ и удаляет орг., что совершенно нормально со мной.Тем не менее, я изо всех сил пытаюсь сделать имена, типа животных, названия животных, некоторые случайные (три здесь, но может быть любым числом) в представление типа значения ключа, чтобы мне не приходилось постоянно настраивать мою схему avroс некоторыми полями, которые я не ожидаю, появляются.