How to write UDF to parse java written map value to Lua table?



Here is my schema: deviceId -> { segId -> {value: …, ttl: 1234} }, each device has many seginfos and each seginfo has “ttl” field to determine expire or not. Now we want to write an UDF to scan all records and find those expired seginfos then remove. The problem is how to parse the map of {value: …, ttl: 1234} because I found it was stored as Bytes which I written in Java. PS: we can’t flatten record as “deviceId, segId, value, ttl” due to query performance issue.