This operator calculated a list of top elements regarding a scoring function. Only if the top elements change, an output will be produced. Additionally, the object that triggered the new calculation is send to output
Outputschema is List<TUPLE>, TUPLE
Remark: Use [] or elementAt to access elements in List and in TUPLE
PARSER PQL
#ADDQUERY
out = TOPK({
k = 10,
scoringfunction = 'price'
},
ELEMENTWINDOW({
size = 5
},
bid
)
)
out2 = MAP({
expressions = [
#LOOP i 0 upto 9
['elementAt(topk[${i}],1)','top_${i+1}_auction'],
['elementAt(topk[0],2)','top_${i+1}_bidder'],
['elementAt(topk[0],4)','top_${i+1}_price'],
#ENDLOOP,
'topk'
],
ALLOWNULL = true,
SUPPRESSERRORS = true
},
out
)
|