The query executor puts results on a queue in separate threads. The calling thread concurrently pops results off the queue through the ResultSet iterator. The aggregation function is called on both server and client (final reduce). Therefore, the Lua script file must also reside on both server and client.
public ResultSet QueryAggregate(
QueryPolicy policy,
Statement statement
)
AerospikeException | if query fails |