wu-sheng commented on code in PR #10448:
URL: https://github.com/apache/skywalking/pull/10448#discussion_r1119472695
##########
oap-server/server-storage-plugin/storage-banyandb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/banyandb/BanyanDBAggregationQueryDAO.java:
##########
@@ -85,24 +60,45 @@ protected void apply(MeasureQuery query) {
throw new IOException("field spec is not registered");
}
+ if (schema.getTopNSpec() == null) {
+ throw new IOException("TopN spec is registered");
+ }
+
+ TopNQueryResponse resp = null;
+ if (condition.getOrder() == Order.DES) {
+ resp = topN(schema, timestampRange, condition.getTopN(),
additionalConditions);
+ } else {
+ resp = bottomN(schema, timestampRange, condition.getTopN(),
additionalConditions);
+ }
Review Comment:
So about the annotation, we could keep
`@BanyanDB.TopNAggregation(groupByTagNames = {"SERVICE_ID"})` for all OAL and
MAL function, and let `groupByTagNames` accepts the column not existing. Then
we even dont' need to update OALRuntime, but keep the annotation on the
function(OAL and MAL) only.
WDYT?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]