ASAPQuery currently rejects grouped aggregate queries that include ORDER BY or LIMIT, even when the aggregation itself is already supported and precomputed.
For example, the following query falls through with destination=none_unsupported:
SELECT proto, srcip, dstip, quantile(0.99)(pkt_len) AS p99_pkt_len FROM netflow_table WHERE time BETWEEN DATEADD(s, -11, NOW()) AND DATEADD(s, -10, NOW()) GROUP BY proto, srcip, dstip ORDER BY p99_pkt_len DESC LIMIT 10
This blocks common analytics patterns such as sorting aggregate results by percentile/sum/count metrics.
Success Criteria
- Queries with supported grouped aggregations continue to match the existing precomputed aggregation path when ORDER BY and/or LIMIT are present.
- ORDER BY on the aggregate alias or aggregate expression is accepted.
- LIMIT is accepted.
- Existing aggregation matching and execution behavior remains unchanged aside from applying ordering/limit to the result set.
ASAPQuery currently rejects grouped aggregate queries that include
ORDER BYorLIMIT, even when the aggregation itself is already supported and precomputed.For example, the following query falls through with destination=none_unsupported:
SELECT proto, srcip, dstip, quantile(0.99)(pkt_len) AS p99_pkt_len FROM netflow_table WHERE time BETWEEN DATEADD(s, -11, NOW()) AND DATEADD(s, -10, NOW()) GROUP BY proto, srcip, dstip ORDER BY p99_pkt_len DESC LIMIT 10This blocks common analytics patterns such as sorting aggregate results by percentile/sum/count metrics.
Success Criteria