This is an automated email from the ASF dual-hosted git repository.
wusheng pushed a commit to branch main
in repository
https://gitbox.apache.org/repos/asf/skywalking-banyandb-java-client.git
The following commit(s) were added to refs/heads/main by this push:
new 8f55dc9 Support stage query on topn (#84)
8f55dc9 is described below
commit 8f55dc9d64f5514d3b2f53cf11fecc80bb5db890
Author: Gao Hongtao <[email protected]>
AuthorDate: Wed May 7 08:15:54 2025 +0800
Support stage query on topn (#84)
Signed-off-by: Gao Hongtao <[email protected]>
---
CHANGES.md | 1 +
src/main/proto/banyandb/v1/banyandb-measure.proto | 16 ++++++++++++++--
.../banyandb/v1/client/BanyanDBClientTestCI.java | 2 +-
3 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/CHANGES.md b/CHANGES.md
index bb4a29e..d5f8c49 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -9,6 +9,7 @@ Release Notes.
* Bump up the API to support sharding_key.
* Bump up the API to support version 0.9.
+* Support stage query on TopN.
0.8.0
------------------
diff --git a/src/main/proto/banyandb/v1/banyandb-measure.proto
b/src/main/proto/banyandb/v1/banyandb-measure.proto
index e7b4de1..4160265 100644
--- a/src/main/proto/banyandb/v1/banyandb-measure.proto
+++ b/src/main/proto/banyandb/v1/banyandb-measure.proto
@@ -38,6 +38,11 @@ message DataPoint {
}
// fields contains fields selected in the projection
repeated Field fields = 3;
+ // sid is the series id of the data point
+ uint64 sid = 4;
+ // version is the version of the data point in a series
+ // sid, timestamp and version are used to identify a data point
+ int64 version = 5;
}
// QueryResponse is the response for a query to the Query module.
@@ -125,6 +130,8 @@ message TopNResponse {
// lists contain a series topN lists ranked by timestamp
// if agg_func in query request is specified, lists' size should be one.
repeated TopNList lists = 1;
+ // trace contains the trace information of the query when trace is enabled
+ common.v1.Trace trace = 2;
}
// TopNRequest is the request contract for query.
@@ -138,15 +145,18 @@ message TopNRequest {
// top_n set the how many items should be returned in each list.
int32 top_n = 4 [(validate.rules).int32.gt = 0];
// agg aggregates lists grouped by field names in the time_range
- // TODO validate enum defined_only
model.v1.AggregationFunction agg = 5;
// criteria select counters. Only equals are acceptable.
repeated model.v1.Condition conditions = 6;
// field_value_sort indicates how to sort fields
model.v1.Sort field_value_sort = 7;
+ // trace is used to enable trace for the query
+ bool trace = 8;
+ // stages is used to specify the stage of the data points in the lifecycle
+ repeated string stages = 9;
}
-//DataPointValue is the data point for writing. It only contains values.
+// DataPointValue is the data point for writing. It only contains values.
message DataPointValue {
// timestamp is in the timeunit of milliseconds.
google.protobuf.Timestamp timestamp = 1 [(validate.rules).timestamp.required
= true];
@@ -154,6 +164,8 @@ message DataPointValue {
repeated model.v1.TagFamilyForWrite tag_families = 2
[(validate.rules).repeated.min_items = 1];
// the order of fields match the measure schema
repeated model.v1.FieldValue fields = 3;
+ // the version of the data point
+ int64 version = 4;
}
// WriteRequest is the request contract for write
diff --git
a/src/test/java/org/apache/skywalking/banyandb/v1/client/BanyanDBClientTestCI.java
b/src/test/java/org/apache/skywalking/banyandb/v1/client/BanyanDBClientTestCI.java
index d2b3f86..e4d1dc1 100644
---
a/src/test/java/org/apache/skywalking/banyandb/v1/client/BanyanDBClientTestCI.java
+++
b/src/test/java/org/apache/skywalking/banyandb/v1/client/BanyanDBClientTestCI.java
@@ -31,7 +31,7 @@ import java.io.IOException;
public class BanyanDBClientTestCI {
private static final String REGISTRY = "ghcr.io";
private static final String IMAGE_NAME = "apache/skywalking-banyandb";
- private static final String TAG =
"c190598804f9dd651b19a188cac2869bf4d8f5c7";
+ private static final String TAG =
"190a7b9bc26a7bcec8c3fbb0aa62b36450664c82";
private static final String IMAGE = REGISTRY + "/" + IMAGE_NAME + ":" +
TAG;