wu-sheng commented on a change in pull request #2: URL: https://github.com/apache/skywalking-banyandb/pull/2#discussion_r638617900
########## File path: api/fbs/v1/query.fbs ########## @@ -0,0 +1,129 @@ +// 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. + +namespace banyandb.v1; + +// BinaryOp specify the operation imposed to the given query condition +enum BinaryOp: byte { + EQ, + NE, + LT, + GT, + LE, + GE, + HAVING, + NOT_HAVING +} + +// BinaryOps is an array of binary operators. +table BinaryOps { + ops: [BinaryOp]; +} + +// IntPair in a typed pair with an array of int64 as values +table IntPair { + key: string; + values: [int64]; +} + +// StrPair in a typed pair with an array of string as values +table StrPair { + key: string; + values: [string]; +} + +// Pair is the building block of a record which is equivalent to a key-value pair. +// In the context of Trace, it could be metadata of a trace such as service_name, serivce_instance, etc. +// Besides, other fields/tags are organized in key-value pair in the underlying storage layer. +// One should notice that the values can be a multi-value. +union TypedPair { IntPair, StrPair } + +// Pair is a workaround since vector of unions is not yet supported in some of languages. +table Pair { + pair: TypedPair; +} + +// TagQuery consists of the query condition with a binary operator to be imposed +table TagQuery { Review comment: Should we consider a new name? Seems we are not using `tag` as a term anymore. -- 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. For queries about this service, please contact Infrastructure at: [email protected]
