This is an automated email from the ASF dual-hosted git repository. mrproliu pushed a commit to branch import-bydbql in repository https://gitbox.apache.org/repos/asf/skywalking-banyandb-client-proto.git
commit 63976306f82073b9bfcc2df3645c4ec82f4ca0f9 Author: mrproliu <[email protected]> AuthorDate: Fri Jul 10 14:47:26 2026 +0800 Import BydbQL into client protocol --- proto/banyandb/v1/banyandb-bydbql.proto | 67 +++++++++++++++++++++++++++++++++ scripts/sync_proto.py | 5 +++ 2 files changed, 72 insertions(+) diff --git a/proto/banyandb/v1/banyandb-bydbql.proto b/proto/banyandb/v1/banyandb-bydbql.proto new file mode 100644 index 0000000..7e7da77 --- /dev/null +++ b/proto/banyandb/v1/banyandb-bydbql.proto @@ -0,0 +1,67 @@ +// Licensed to Apache Software Foundation (ASF) under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Apache Software Foundation (ASF) licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +syntax = "proto3"; + +option java_package = "org.apache.skywalking.banyandb.bydbql.v1"; + +package banyandb.bydbql.v1; + +import "validate/validate.proto"; +import "banyandb/v1/banyandb-measure.proto"; +import "banyandb/v1/banyandb-model.proto"; +import "banyandb/v1/banyandb-property.proto"; +import "banyandb/v1/banyandb-stream.proto"; +import "banyandb/v1/banyandb-trace.proto"; + +// QueryRequest is the main request message for BydbQL queries +message QueryRequest { + // query is the BydbQL query string + string query = 1 [(validate.rules).string.min_len = 1]; + // params are bound to the `?` placeholders in the query string by their order of appearance. + // The number of params must match the number of placeholders. + // Accepted variants depend on the placeholder's position: str/timestamp for TIME values, + // str/int/null for scalar comparisons, str/int/null/str_array/int_array for IN/MATCH/HAVING + // value lists (arrays expand in place), and int for LIMIT/OFFSET/TOP N counts. + // binary_data is rejected everywhere. + repeated model.v1.TagValue params = 2; +} + +// QueryResponse contains the result of a BydbQL query +message QueryResponse { + // result contains the actual query result based on the query type + oneof result { + // stream_result is returned for stream queries + stream.v1.QueryResponse stream_result = 1; + // measure_result is returned for measure queries + measure.v1.QueryResponse measure_result = 2; + // property_result is returned for property queries + property.v1.QueryResponse property_result = 3; + // trace_result is returned for trace queries + trace.v1.QueryResponse trace_result = 4; + // topn_result is returned for TopN queries + measure.v1.TopNResponse topn_result = 5; + } +} + +// BydbQLService provides query interface for BanyanDB Query Language (BydbQL) +service BydbQLService { + // Query executes a generic BydbQL query with explicit FROM clause + // This endpoint requires the query to specify the resource type and name + // in the FROM clause (e.g., "FROM STREAM sw", "FROM MEASURE metrics") + rpc Query(QueryRequest) returns (QueryResponse); +} diff --git a/scripts/sync_proto.py b/scripts/sync_proto.py index e8115cf..5daa221 100755 --- a/scripts/sync_proto.py +++ b/scripts/sync_proto.py @@ -47,6 +47,7 @@ MODULES = { 'common': {'files': 'all'}, 'database': {'files': ['schema.proto', 'rpc.proto']}, 'measure': {'files': 'all'}, + 'bydbql': {'files': ['query.proto', 'rpc.proto']}, 'model': {'files': 'all'}, 'property': {'files': ['property.proto', 'rpc.proto']}, 'stream': {'files': 'all'}, @@ -68,6 +69,10 @@ EXCLUDE_LIST = { 'messages': ['DeleteExpiredSegmentsRequest', 'DeleteExpiredSegmentsResponse', 'InternalWriteRequest'], 'rpcs': ['DeleteExpiredSegments'] }, + 'bydbql': { + 'messages': [], + 'rpcs': [] + }, 'model': { 'messages': [], 'rpcs': []
