NXP-15042: add aggregates support to query api