andrisnoko commented on code in PR #15982: URL: https://github.com/apache/druid/pull/15982#discussion_r1679938643
########## extensions-contrib/grpc-query/src/main/proto/query.proto: ########## @@ -0,0 +1,143 @@ +// Licensed to the 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. +// The 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.druid.grpc.proto"; + +import "google/protobuf/timestamp.proto"; + +package druidGrpc; + +service Query { + rpc SubmitQuery (QueryRequest) returns (QueryResponse) {} +} + +enum QueryType { + NATIVE = 0; + SQL = 1; +} + +// Defines the format of the query results. Must be one of the +// non-unknown formats. +enum QueryResultFormat { + UNKNOWN_FORMAT = 0; // Default value. An old server will see this value + // (and fail the request) if a new client passes a new format. + CSV = 1; + // JSON_OBJECT = 2; -- Not yet + JSON_ARRAY = 3; + // JSON_OBJECT_LINES = 4; -- Not yet + JSON_ARRAY_LINES = 5; + + // The protobuf formats also require that the protobufMessageName be set in + // the query request. + PROTOBUF_INLINE = 6; + PROTOBUF_RESPONSE = 7; +} + +// Value for a query parameter. The value is essentially a variant of the +// supported parameter types. The type chosen here must match (or be converable +// to) the type of the corresponding expression in the SQL statement. +message QueryParameter { + oneof value { + bool nullValue = 1; + string stringValue = 2; + sint64 longValue = 3; + double doubleValue = 4; + StringArray arrayValue = 5; + } +} + +// Query pararameter value for string array properties. At present, string +// arrays are primarily used by the MSQ engine, which is not yet available +// via the gRPC API. +message StringArray { + repeated string value = 1; +} + +message QueryRequest { + QueryType queryType = 1; Review Comment: @Rishabh Could you make that QueryType is the last field in this proto to preserve the original order to avoid breaking changes and also give QueryType a default value of SQL. -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
