I need to write a flink udf that can return Map<String, Object>, how do I achieve this.
At best I could get output = @DataTypeHint(value = "MAP<STRING, STRING>", bridgedTo = MapData.class)
working. This only return map<String, String>
I have need to return data like
<code>{
"cloudStatus": "UNREGISTERED",
"lastLoginTimestamp": "Tue Jul 18 15:22:33 GMT 2023",
"visibleSegments": ["one", "two"],
"booleanValue": true,
"intValue": 123,
"floatValue": 456.67,
"sysDescriptions": {
"en_US": "ADFlatFile 015 entitlement0001 desc"
},
"list_of_list": [["one", "two"]],
"list_of_map": [
{
"k2": true,
"k1": 10,
"k3": "v3"
}
],
"ou.location": "12334",
"ou.position": "assd",
"ou.operating.company": "abc_er",
"member.value": "abc_er"
}
</code>
<code>{
"cloudStatus": "UNREGISTERED",
"lastLoginTimestamp": "Tue Jul 18 15:22:33 GMT 2023",
"visibleSegments": ["one", "two"],
"booleanValue": true,
"intValue": 123,
"floatValue": 456.67,
"sysDescriptions": {
"en_US": "ADFlatFile 015 entitlement0001 desc"
},
"list_of_list": [["one", "two"]],
"list_of_map": [
{
"k2": true,
"k1": 10,
"k3": "v3"
}
],
"ou.location": "12334",
"ou.position": "assd",
"ou.operating.company": "abc_er",
"member.value": "abc_er"
}
</code>
{
"cloudStatus": "UNREGISTERED",
"lastLoginTimestamp": "Tue Jul 18 15:22:33 GMT 2023",
"visibleSegments": ["one", "two"],
"booleanValue": true,
"intValue": 123,
"floatValue": 456.67,
"sysDescriptions": {
"en_US": "ADFlatFile 015 entitlement0001 desc"
},
"list_of_list": [["one", "two"]],
"list_of_map": [
{
"k2": true,
"k1": 10,
"k3": "v3"
}
],
"ou.location": "12334",
"ou.position": "assd",
"ou.operating.company": "abc_er",
"member.value": "abc_er"
}
Input to the UDF is a json that represent similar data as above
2