blob: 7b74f6a804770a9dece95ccaccbc235b41d6de6f [file] [log] [blame]
// 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="proto2";
package doris;
option java_package = "org.apache.doris.proto";
message PStatus {
required int32 status_code = 1;
repeated string error_msgs = 2;
};
message PScalarType {
// TPrimitiveType, use int32 to avoid redefine Enum
required int32 type = 1;
// Only set if type == CHAR or type == VARCHAR
optional int32 len = 2;
// Only set for DECIMAL
optional int32 precision = 3;
optional int32 scale = 4;
};
// Represents a field in a STRUCT type.
// TODO: Model column stats for struct fields.
message PStructField {
required string name = 1;
optional string comment = 2;
optional bool contains_null = 3;
};
message PTypeNode {
// TTypeNodeType(SCALAR, ARRAY, MAP, STRUCT)
required int32 type = 1;
// only set for scalar types
optional PScalarType scalar_type = 2;
// only used for structs; has struct_fields.size() corresponding child types
repeated PStructField struct_fields = 3;
// only used for complex types, such as array, map and etc.
optional bool contains_null = 4;
};
// A flattened representation of a tree of column types obtained by depth-first
// traversal. Complex types such as map, array and struct have child types corresponding
// to the map key/value, array item type, and struct fields, respectively.
// For scalar types the list contains only a single node.
// Note: We cannot rename this to TType because it conflicts with Thrift's internal TType
// and the generated Python thrift files will not work.
// Note: TTypeDesc in impala is TColumnType, but we already use TColumnType, so we name this
// to TTypeDesc. In future, we merge these two to one
message PTypeDesc {
repeated PTypeNode types = 1;
};
message PUniqueId {
required int64 hi = 1;
required int64 lo = 2;
};
message PGenericType {
enum TypeId {
UINT8 = 0;
UINT16 = 1;
UINT32 = 2;
UINT64 = 3;
UINT128 = 4;
UINT256 = 5;
INT8 = 6;
INT16 = 7;
INT32 = 8;
INT64 = 9;
INT128 = 10;
INT256 = 11;
FLOAT = 12; // map to Float32
DOUBLE = 13; // map to Float64
BOOLEAN = 14;
DATE = 15;
DATETIME = 16;
HLL = 17;
BITMAP = 18;
LIST = 19;
MAP = 20;
STRUCT =21;
STRING = 22;
DECIMAL32 = 23;
DECIMAL64 = 24;
DECIMAL128 = 25;
BYTES = 26;
NOTHING = 27;
DATEV2 = 28;
DATETIMEV2 = 29;
FIXEDLENGTHOBJECT = 30;
JSONB = 31;
DECIMAL128I = 32;
VARIANT = 33;
QUANTILE_STATE = 34;
TIME = 35;
AGG_STATE = 36;
UNKNOWN = 999;
}
required TypeId id = 2;
optional PList list_type = 11;
optional PMap map_type = 12;
optional PStruct struct_type = 13;
optional PDecimal decimal_type = 14;
}
message PList {
required PGenericType element_type = 1;
}
message PMap {
required PGenericType key_type = 1;
required PGenericType value_type = 2;
}
message PField {
required PGenericType type = 1;
optional string name = 2;
optional string comment = 3;
}
message PStruct {
repeated PField fields = 1;
required string name = 2;
}
message PDecimal {
required uint32 precision = 1;
required uint32 scale = 2;
}
message PDateTime {
optional int32 year = 1;
optional int32 month = 2;
optional int32 day = 3;
optional int32 hour = 4;
optional int32 minute = 5;
optional int32 second = 6;
optional int32 microsecond = 7;
}
message PValue {
required PGenericType type = 1;
optional bool is_null = 2 [default = false];
optional double double_value = 3;
optional float float_value = 4;
optional int32 int32_value = 5;
optional int64 int64_value = 6;
optional uint32 uint32_value = 7;
optional uint64 uint64_value = 8;
optional bool bool_value = 9;
optional string string_value = 10;
optional bytes bytes_value = 11;
optional PDateTime datetime_value = 12;
}
message PValues {
required PGenericType type = 1;
optional bool has_null = 2 [default = false];
repeated bool null_map = 3;
repeated double double_value = 4;
repeated float float_value = 5;
repeated int32 int32_value = 6;
repeated int64 int64_value = 7;
repeated uint32 uint32_value = 8;
repeated uint64 uint64_value = 9;
repeated bool bool_value = 10;
repeated string string_value = 11;
repeated bytes bytes_value = 12;
repeated PDateTime datetime_value = 13;
}
// this mesage may not used for now
message PFunction {
enum FunctionType {
UDF = 0;
// not supported now
UDAF = 1;
UDTF = 2;
}
message Property {
required string key = 1;
required string val = 2;
};
required string function_name = 1;
repeated PGenericType inputs = 2;
optional PGenericType output = 3;
optional FunctionType type = 4 [default = UDF];
optional bool variadic = 5;
repeated Property properties = 6;
}
message PFunctionContext {
optional bytes data = 1;
//use to impl vectorization udaf
repeated PValues args_data = 2;
}
message PHandShakeRequest {
optional string hello = 1;
}
message PHandShakeResponse {
optional PStatus status = 1;
optional string hello = 2;
}
enum PPlanFragmentCancelReason {
// 0 is reserved
LIMIT_REACH = 1;
USER_CANCEL = 2;
INTERNAL_ERROR = 3;
TIMEOUT = 4;
CALL_RPC_ERROR = 5;
MEMORY_LIMIT_EXCEED = 6;
}