Skip to content

Commit 836d0d0

Browse files
authored
Update TopNQuery to support multiple stages (#85)
Signed-off-by: Gao Hongtao <hanahmily@gmail.com>
1 parent 8f55dc9 commit 836d0d0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/main/java/org/apache/skywalking/banyandb/v1/client/TopNQuery.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public class TopNQuery {
3434
private final int number;
3535
private final AbstractQuery.Sort sort;
3636
private MeasureQuery.Aggregation.Type aggregationType = MeasureQuery.Aggregation.Type.UNSPECIFIED;
37+
private List<String> stages;
3738
/**
3839
* Query conditions.
3940
*/
@@ -69,6 +70,11 @@ BanyandbMeasure.TopNRequest build() throws BanyanDBException {
6970
bld.addConditions(expr.build().getCondition());
7071
}
7172
}
73+
if (stages != null && !stages.isEmpty()) {
74+
for (String stage : stages) {
75+
bld.addStages(stage);
76+
}
77+
}
7278
return bld.build();
7379
}
7480
}

0 commit comments

Comments
 (0)