Skip to content

Commit 8f55dc9

Browse files
authored
Support stage query on topn (#84)
Signed-off-by: Gao Hongtao <[email protected]>
1 parent 661a39f commit 8f55dc9

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Release Notes.
99

1010
* Bump up the API to support sharding_key.
1111
* Bump up the API to support version 0.9.
12+
* Support stage query on TopN.
1213

1314
0.8.0
1415
------------------

src/main/proto/banyandb/v1/banyandb-measure.proto

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ message DataPoint {
3838
}
3939
// fields contains fields selected in the projection
4040
repeated Field fields = 3;
41+
// sid is the series id of the data point
42+
uint64 sid = 4;
43+
// version is the version of the data point in a series
44+
// sid, timestamp and version are used to identify a data point
45+
int64 version = 5;
4146
}
4247

4348
// QueryResponse is the response for a query to the Query module.
@@ -125,6 +130,8 @@ message TopNResponse {
125130
// lists contain a series topN lists ranked by timestamp
126131
// if agg_func in query request is specified, lists' size should be one.
127132
repeated TopNList lists = 1;
133+
// trace contains the trace information of the query when trace is enabled
134+
common.v1.Trace trace = 2;
128135
}
129136

130137
// TopNRequest is the request contract for query.
@@ -138,22 +145,27 @@ message TopNRequest {
138145
// top_n set the how many items should be returned in each list.
139146
int32 top_n = 4 [(validate.rules).int32.gt = 0];
140147
// agg aggregates lists grouped by field names in the time_range
141-
// TODO validate enum defined_only
142148
model.v1.AggregationFunction agg = 5;
143149
// criteria select counters. Only equals are acceptable.
144150
repeated model.v1.Condition conditions = 6;
145151
// field_value_sort indicates how to sort fields
146152
model.v1.Sort field_value_sort = 7;
153+
// trace is used to enable trace for the query
154+
bool trace = 8;
155+
// stages is used to specify the stage of the data points in the lifecycle
156+
repeated string stages = 9;
147157
}
148158

149-
//DataPointValue is the data point for writing. It only contains values.
159+
// DataPointValue is the data point for writing. It only contains values.
150160
message DataPointValue {
151161
// timestamp is in the timeunit of milliseconds.
152162
google.protobuf.Timestamp timestamp = 1 [(validate.rules).timestamp.required = true];
153163
// the order of tag_families' items match the measure schema
154164
repeated model.v1.TagFamilyForWrite tag_families = 2 [(validate.rules).repeated.min_items = 1];
155165
// the order of fields match the measure schema
156166
repeated model.v1.FieldValue fields = 3;
167+
// the version of the data point
168+
int64 version = 4;
157169
}
158170

159171
// WriteRequest is the request contract for write

src/test/java/org/apache/skywalking/banyandb/v1/client/BanyanDBClientTestCI.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
public class BanyanDBClientTestCI {
3232
private static final String REGISTRY = "ghcr.io";
3333
private static final String IMAGE_NAME = "apache/skywalking-banyandb";
34-
private static final String TAG = "c190598804f9dd651b19a188cac2869bf4d8f5c7";
34+
private static final String TAG = "190a7b9bc26a7bcec8c3fbb0aa62b36450664c82";
3535

3636
private static final String IMAGE = REGISTRY + "/" + IMAGE_NAME + ":" + TAG;
3737

0 commit comments

Comments
 (0)