I consume data from a kafka topic (nested json) which has to be filtered based on a field value.
So I used the ExecuteScript processor to filter out records and transform some fields.
For filtering I used findAll function without using QueryRecord and it worked.
My question here is does this approach solve the same purpose as QueryRecord processor for filtering because I'm NOT sure how to use query record when there are nested json objects from the incoming flowfiles.
I tried queryrecord but it threw an error:
SELECT * FROM FLOWFILE WHERE RPATH(order, '/orderDetail/orderId') = '1126'
Error:
No match found for function signature RPATH(<JavaType(...Record)>,<CHARACTER>)
org.apache.calcite.runtime.CalciteContextException
Sample Data:
{
"retail":{
"retailId":"6133",
"retailName":"Maveric"
},
"order":{
"orderDetail":{
"orderId":"1126",
"orderName":"NNDRFG"
}
}
}