feat: add json type proto (#188)

* feat: add type extension for json type

* refactor: use a extension type

* refactor: as enum
This commit is contained in:
Yohan Wal
2024-09-09 16:14:58 +08:00
committed by GitHub
parent 157cfdb527
commit 973f49cde8
5 changed files with 611 additions and 103 deletions
+78 -28
View File
@@ -299,7 +299,7 @@ PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORIT
} // namespace v1 } // namespace v1
} // namespace greptime } // namespace greptime
static ::_pb::Metadata file_level_metadata_greptime_2fv1_2fcommon_2eproto[20]; static ::_pb::Metadata file_level_metadata_greptime_2fv1_2fcommon_2eproto[20];
static const ::_pb::EnumDescriptor* file_level_enum_descriptors_greptime_2fv1_2fcommon_2eproto[2]; static const ::_pb::EnumDescriptor* file_level_enum_descriptors_greptime_2fv1_2fcommon_2eproto[3];
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_greptime_2fv1_2fcommon_2eproto = nullptr; static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_greptime_2fv1_2fcommon_2eproto = nullptr;
const uint32_t TableStruct_greptime_2fv1_2fcommon_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { const uint32_t TableStruct_greptime_2fv1_2fcommon_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
@@ -447,6 +447,7 @@ const uint32_t TableStruct_greptime_2fv1_2fcommon_2eproto::offsets[] PROTOBUF_SE
~0u, // no _weak_field_map_ ~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_ ~0u, // no _inlined_string_donated_
::_pbi::kInvalidFieldOffsetTag, ::_pbi::kInvalidFieldOffsetTag,
::_pbi::kInvalidFieldOffsetTag,
PROTOBUF_FIELD_OFFSET(::greptime::v1::ColumnDataTypeExtension, _impl_.type_ext_), PROTOBUF_FIELD_OFFSET(::greptime::v1::ColumnDataTypeExtension, _impl_.type_ext_),
~0u, // no _has_bits_ ~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::greptime::v1::DecimalTypeExtension, _internal_metadata_), PROTOBUF_FIELD_OFFSET(::greptime::v1::DecimalTypeExtension, _internal_metadata_),
@@ -492,9 +493,9 @@ static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protode
{ 120, -1, -1, sizeof(::greptime::v1::IntervalMonthDayNano)}, { 120, -1, -1, sizeof(::greptime::v1::IntervalMonthDayNano)},
{ 129, -1, -1, sizeof(::greptime::v1::Decimal128)}, { 129, -1, -1, sizeof(::greptime::v1::Decimal128)},
{ 137, -1, -1, sizeof(::greptime::v1::ColumnDataTypeExtension)}, { 137, -1, -1, sizeof(::greptime::v1::ColumnDataTypeExtension)},
{ 145, -1, -1, sizeof(::greptime::v1::DecimalTypeExtension)}, { 146, -1, -1, sizeof(::greptime::v1::DecimalTypeExtension)},
{ 153, 161, -1, sizeof(::greptime::v1::ColumnOptions_OptionsEntry_DoNotUse)}, { 154, 162, -1, sizeof(::greptime::v1::ColumnOptions_OptionsEntry_DoNotUse)},
{ 163, -1, -1, sizeof(::greptime::v1::ColumnOptions)}, { 164, -1, -1, sizeof(::greptime::v1::ColumnOptions)},
}; };
static const ::_pb::Message* const file_default_instances[] = { static const ::_pb::Message* const file_default_instances[] = {
@@ -550,33 +551,35 @@ const char descriptor_table_protodef_greptime_2fv1_2fcommon_2eproto[] PROTOBUF_S
"2\024.greptime.v1.Metrics\"I\n\024IntervalMonthD" "2\024.greptime.v1.Metrics\"I\n\024IntervalMonthD"
"ayNano\022\016\n\006months\030\001 \001(\005\022\014\n\004days\030\002 \001(\005\022\023\n\013" "ayNano\022\016\n\006months\030\001 \001(\005\022\014\n\004days\030\002 \001(\005\022\023\n\013"
"nanoseconds\030\003 \001(\003\"$\n\nDecimal128\022\n\n\002hi\030\001 " "nanoseconds\030\003 \001(\003\"$\n\nDecimal128\022\n\n\002hi\030\001 "
"\001(\003\022\n\n\002lo\030\002 \001(\003\"`\n\027ColumnDataTypeExtensi" "\001(\003\022\n\n\002lo\030\002 \001(\003\"\225\001\n\027ColumnDataTypeExtens"
"on\0229\n\014decimal_type\030\001 \001(\0132!.greptime.v1.D" "ion\0229\n\014decimal_type\030\001 \001(\0132!.greptime.v1."
"ecimalTypeExtensionH\000B\n\n\010type_ext\"8\n\024Dec" "DecimalTypeExtensionH\000\0223\n\tjson_type\030\002 \001("
"imalTypeExtension\022\021\n\tprecision\030\001 \001(\005\022\r\n\005" "\0162\036.greptime.v1.JsonTypeExtensionH\000B\n\n\010t"
"scale\030\002 \001(\005\"y\n\rColumnOptions\0228\n\007options\030" "ype_ext\"8\n\024DecimalTypeExtension\022\021\n\tpreci"
"\001 \003(\0132\'.greptime.v1.ColumnOptions.Option" "sion\030\001 \001(\005\022\r\n\005scale\030\002 \001(\005\"y\n\rColumnOptio"
"sEntry\032.\n\014OptionsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005v" "ns\0228\n\007options\030\001 \003(\0132\'.greptime.v1.Column"
"alue\030\002 \001(\t:\0028\001*1\n\014SemanticType\022\007\n\003TAG\020\000\022" "Options.OptionsEntry\032.\n\014OptionsEntry\022\013\n\003"
"\t\n\005FIELD\020\001\022\r\n\tTIMESTAMP\020\002*\326\003\n\016ColumnData" "key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001*1\n\014Semantic"
"Type\022\013\n\007BOOLEAN\020\000\022\010\n\004INT8\020\001\022\t\n\005INT16\020\002\022\t" "Type\022\007\n\003TAG\020\000\022\t\n\005FIELD\020\001\022\r\n\tTIMESTAMP\020\002*"
"\n\005INT32\020\003\022\t\n\005INT64\020\004\022\t\n\005UINT8\020\005\022\n\n\006UINT1" "\326\003\n\016ColumnDataType\022\013\n\007BOOLEAN\020\000\022\010\n\004INT8\020"
"6\020\006\022\n\n\006UINT32\020\007\022\n\n\006UINT64\020\010\022\013\n\007FLOAT32\020\t" "\001\022\t\n\005INT16\020\002\022\t\n\005INT32\020\003\022\t\n\005INT64\020\004\022\t\n\005UI"
"\022\013\n\007FLOAT64\020\n\022\n\n\006BINARY\020\013\022\n\n\006STRING\020\014\022\010\n" "NT8\020\005\022\n\n\006UINT16\020\006\022\n\n\006UINT32\020\007\022\n\n\006UINT64\020"
"\004DATE\020\r\022\014\n\010DATETIME\020\016\022\024\n\020TIMESTAMP_SECON" "\010\022\013\n\007FLOAT32\020\t\022\013\n\007FLOAT64\020\n\022\n\n\006BINARY\020\013\022"
"D\020\017\022\031\n\025TIMESTAMP_MILLISECOND\020\020\022\031\n\025TIMEST" "\n\n\006STRING\020\014\022\010\n\004DATE\020\r\022\014\n\010DATETIME\020\016\022\024\n\020T"
"AMP_MICROSECOND\020\021\022\030\n\024TIMESTAMP_NANOSECON" "IMESTAMP_SECOND\020\017\022\031\n\025TIMESTAMP_MILLISECO"
"D\020\022\022\017\n\013TIME_SECOND\020\023\022\024\n\020TIME_MILLISECOND" "ND\020\020\022\031\n\025TIMESTAMP_MICROSECOND\020\021\022\030\n\024TIMES"
"\020\024\022\024\n\020TIME_MICROSECOND\020\025\022\023\n\017TIME_NANOSEC" "TAMP_NANOSECOND\020\022\022\017\n\013TIME_SECOND\020\023\022\024\n\020TI"
"OND\020\026\022\027\n\023INTERVAL_YEAR_MONTH\020\027\022\025\n\021INTERV" "ME_MILLISECOND\020\024\022\024\n\020TIME_MICROSECOND\020\025\022\023"
"AL_DAY_TIME\020\030\022\033\n\027INTERVAL_MONTH_DAY_NANO" "\n\017TIME_NANOSECOND\020\026\022\027\n\023INTERVAL_YEAR_MON"
"\020\031\022\016\n\nDECIMAL128\020\036BO\n\016io.greptime.v1B\006Co" "TH\020\027\022\025\n\021INTERVAL_DAY_TIME\020\030\022\033\n\027INTERVAL_"
"mmonZ5github.com/GreptimeTeam/greptime-p" "MONTH_DAY_NANO\020\031\022\016\n\nDECIMAL128\020\036*$\n\021Json"
"roto/go/greptime/v1b\006proto3" "TypeExtension\022\017\n\013JSON_BINARY\020\000BO\n\016io.gre"
"ptime.v1B\006CommonZ5github.com/GreptimeTea"
"m/greptime-proto/go/greptime/v1b\006proto3"
; ;
static ::_pbi::once_flag descriptor_table_greptime_2fv1_2fcommon_2eproto_once; static ::_pbi::once_flag descriptor_table_greptime_2fv1_2fcommon_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_greptime_2fv1_2fcommon_2eproto = { const ::_pbi::DescriptorTable descriptor_table_greptime_2fv1_2fcommon_2eproto = {
false, false, 2067, descriptor_table_protodef_greptime_2fv1_2fcommon_2eproto, false, false, 2159, descriptor_table_protodef_greptime_2fv1_2fcommon_2eproto,
"greptime/v1/common.proto", "greptime/v1/common.proto",
&descriptor_table_greptime_2fv1_2fcommon_2eproto_once, nullptr, 0, 20, &descriptor_table_greptime_2fv1_2fcommon_2eproto_once, nullptr, 0, 20,
schemas, file_default_instances, TableStruct_greptime_2fv1_2fcommon_2eproto::offsets, schemas, file_default_instances, TableStruct_greptime_2fv1_2fcommon_2eproto::offsets,
@@ -645,6 +648,19 @@ bool ColumnDataType_IsValid(int value) {
} }
} }
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* JsonTypeExtension_descriptor() {
::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_greptime_2fv1_2fcommon_2eproto);
return file_level_enum_descriptors_greptime_2fv1_2fcommon_2eproto[2];
}
bool JsonTypeExtension_IsValid(int value) {
switch (value) {
case 0:
return true;
default:
return false;
}
}
// =================================================================== // ===================================================================
@@ -4309,6 +4325,10 @@ ColumnDataTypeExtension::ColumnDataTypeExtension(const ColumnDataTypeExtension&
from._internal_decimal_type()); from._internal_decimal_type());
break; break;
} }
case kJsonType: {
_this->_internal_set_json_type(from._internal_json_type());
break;
}
case TYPE_EXT_NOT_SET: { case TYPE_EXT_NOT_SET: {
break; break;
} }
@@ -4357,6 +4377,10 @@ void ColumnDataTypeExtension::clear_type_ext() {
} }
break; break;
} }
case kJsonType: {
// No need to clear
break;
}
case TYPE_EXT_NOT_SET: { case TYPE_EXT_NOT_SET: {
break; break;
} }
@@ -4389,6 +4413,15 @@ const char* ColumnDataTypeExtension::_InternalParse(const char* ptr, ::_pbi::Par
} else } else
goto handle_unusual; goto handle_unusual;
continue; continue;
// .greptime.v1.JsonTypeExtension json_type = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
_internal_set_json_type(static_cast<::greptime::v1::JsonTypeExtension>(val));
} else
goto handle_unusual;
continue;
default: default:
goto handle_unusual; goto handle_unusual;
} // switch } // switch
@@ -4425,6 +4458,13 @@ uint8_t* ColumnDataTypeExtension::_InternalSerialize(
_Internal::decimal_type(this).GetCachedSize(), target, stream); _Internal::decimal_type(this).GetCachedSize(), target, stream);
} }
// .greptime.v1.JsonTypeExtension json_type = 2;
if (_internal_has_json_type()) {
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteEnumToArray(
2, this->_internal_json_type(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
@@ -4449,6 +4489,12 @@ size_t ColumnDataTypeExtension::ByteSizeLong() const {
*_impl_.type_ext_.decimal_type_); *_impl_.type_ext_.decimal_type_);
break; break;
} }
// .greptime.v1.JsonTypeExtension json_type = 2;
case kJsonType: {
total_size += 1 +
::_pbi::WireFormatLite::EnumSize(this->_internal_json_type());
break;
}
case TYPE_EXT_NOT_SET: { case TYPE_EXT_NOT_SET: {
break; break;
} }
@@ -4477,6 +4523,10 @@ void ColumnDataTypeExtension::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg
from._internal_decimal_type()); from._internal_decimal_type());
break; break;
} }
case kJsonType: {
_this->_internal_set_json_type(from._internal_json_type());
break;
}
case TYPE_EXT_NOT_SET: { case TYPE_EXT_NOT_SET: {
break; break;
} }
+84
View File
@@ -213,6 +213,30 @@ inline bool ColumnDataType_Parse(
return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<ColumnDataType>( return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<ColumnDataType>(
ColumnDataType_descriptor(), name, value); ColumnDataType_descriptor(), name, value);
} }
enum JsonTypeExtension : int {
JSON_BINARY = 0,
JsonTypeExtension_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<int32_t>::min(),
JsonTypeExtension_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<int32_t>::max()
};
bool JsonTypeExtension_IsValid(int value);
constexpr JsonTypeExtension JsonTypeExtension_MIN = JSON_BINARY;
constexpr JsonTypeExtension JsonTypeExtension_MAX = JSON_BINARY;
constexpr int JsonTypeExtension_ARRAYSIZE = JsonTypeExtension_MAX + 1;
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* JsonTypeExtension_descriptor();
template<typename T>
inline const std::string& JsonTypeExtension_Name(T enum_t_value) {
static_assert(::std::is_same<T, JsonTypeExtension>::value ||
::std::is_integral<T>::value,
"Incorrect type passed to function JsonTypeExtension_Name.");
return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum(
JsonTypeExtension_descriptor(), enum_t_value);
}
inline bool JsonTypeExtension_Parse(
::PROTOBUF_NAMESPACE_ID::ConstStringParam name, JsonTypeExtension* value) {
return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<JsonTypeExtension>(
JsonTypeExtension_descriptor(), name, value);
}
// =================================================================== // ===================================================================
class QueryContext_ExtensionsEntry_DoNotUse : public ::PROTOBUF_NAMESPACE_ID::internal::MapEntry<QueryContext_ExtensionsEntry_DoNotUse, class QueryContext_ExtensionsEntry_DoNotUse : public ::PROTOBUF_NAMESPACE_ID::internal::MapEntry<QueryContext_ExtensionsEntry_DoNotUse,
@@ -2764,6 +2788,7 @@ class ColumnDataTypeExtension final :
} }
enum TypeExtCase { enum TypeExtCase {
kDecimalType = 1, kDecimalType = 1,
kJsonType = 2,
TYPE_EXT_NOT_SET = 0, TYPE_EXT_NOT_SET = 0,
}; };
@@ -2846,6 +2871,7 @@ class ColumnDataTypeExtension final :
enum : int { enum : int {
kDecimalTypeFieldNumber = 1, kDecimalTypeFieldNumber = 1,
kJsonTypeFieldNumber = 2,
}; };
// .greptime.v1.DecimalTypeExtension decimal_type = 1; // .greptime.v1.DecimalTypeExtension decimal_type = 1;
bool has_decimal_type() const; bool has_decimal_type() const;
@@ -2865,12 +2891,26 @@ class ColumnDataTypeExtension final :
::greptime::v1::DecimalTypeExtension* decimal_type); ::greptime::v1::DecimalTypeExtension* decimal_type);
::greptime::v1::DecimalTypeExtension* unsafe_arena_release_decimal_type(); ::greptime::v1::DecimalTypeExtension* unsafe_arena_release_decimal_type();
// .greptime.v1.JsonTypeExtension json_type = 2;
bool has_json_type() const;
private:
bool _internal_has_json_type() const;
public:
void clear_json_type();
::greptime::v1::JsonTypeExtension json_type() const;
void set_json_type(::greptime::v1::JsonTypeExtension value);
private:
::greptime::v1::JsonTypeExtension _internal_json_type() const;
void _internal_set_json_type(::greptime::v1::JsonTypeExtension value);
public:
void clear_type_ext(); void clear_type_ext();
TypeExtCase type_ext_case() const; TypeExtCase type_ext_case() const;
// @@protoc_insertion_point(class_scope:greptime.v1.ColumnDataTypeExtension) // @@protoc_insertion_point(class_scope:greptime.v1.ColumnDataTypeExtension)
private: private:
class _Internal; class _Internal;
void set_has_decimal_type(); void set_has_decimal_type();
void set_has_json_type();
inline bool has_type_ext() const; inline bool has_type_ext() const;
inline void clear_has_type_ext(); inline void clear_has_type_ext();
@@ -2883,6 +2923,7 @@ class ColumnDataTypeExtension final :
constexpr TypeExtUnion() : _constinit_{} {} constexpr TypeExtUnion() : _constinit_{} {}
::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized _constinit_; ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized _constinit_;
::greptime::v1::DecimalTypeExtension* decimal_type_; ::greptime::v1::DecimalTypeExtension* decimal_type_;
int json_type_;
} type_ext_; } type_ext_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
uint32_t _oneof_case_[1]; uint32_t _oneof_case_[1];
@@ -4891,6 +4932,44 @@ inline ::greptime::v1::DecimalTypeExtension* ColumnDataTypeExtension::mutable_de
return _msg; return _msg;
} }
// .greptime.v1.JsonTypeExtension json_type = 2;
inline bool ColumnDataTypeExtension::_internal_has_json_type() const {
return type_ext_case() == kJsonType;
}
inline bool ColumnDataTypeExtension::has_json_type() const {
return _internal_has_json_type();
}
inline void ColumnDataTypeExtension::set_has_json_type() {
_impl_._oneof_case_[0] = kJsonType;
}
inline void ColumnDataTypeExtension::clear_json_type() {
if (_internal_has_json_type()) {
_impl_.type_ext_.json_type_ = 0;
clear_has_type_ext();
}
}
inline ::greptime::v1::JsonTypeExtension ColumnDataTypeExtension::_internal_json_type() const {
if (_internal_has_json_type()) {
return static_cast< ::greptime::v1::JsonTypeExtension >(_impl_.type_ext_.json_type_);
}
return static_cast< ::greptime::v1::JsonTypeExtension >(0);
}
inline ::greptime::v1::JsonTypeExtension ColumnDataTypeExtension::json_type() const {
// @@protoc_insertion_point(field_get:greptime.v1.ColumnDataTypeExtension.json_type)
return _internal_json_type();
}
inline void ColumnDataTypeExtension::_internal_set_json_type(::greptime::v1::JsonTypeExtension value) {
if (!_internal_has_json_type()) {
clear_type_ext();
set_has_json_type();
}
_impl_.type_ext_.json_type_ = value;
}
inline void ColumnDataTypeExtension::set_json_type(::greptime::v1::JsonTypeExtension value) {
_internal_set_json_type(value);
// @@protoc_insertion_point(field_set:greptime.v1.ColumnDataTypeExtension.json_type)
}
inline bool ColumnDataTypeExtension::has_type_ext() const { inline bool ColumnDataTypeExtension::has_type_ext() const {
return type_ext_case() != TYPE_EXT_NOT_SET; return type_ext_case() != TYPE_EXT_NOT_SET;
} }
@@ -5038,6 +5117,11 @@ template <>
inline const EnumDescriptor* GetEnumDescriptor< ::greptime::v1::ColumnDataType>() { inline const EnumDescriptor* GetEnumDescriptor< ::greptime::v1::ColumnDataType>() {
return ::greptime::v1::ColumnDataType_descriptor(); return ::greptime::v1::ColumnDataType_descriptor();
} }
template <> struct is_proto_enum< ::greptime::v1::JsonTypeExtension> : ::std::true_type {};
template <>
inline const EnumDescriptor* GetEnumDescriptor< ::greptime::v1::JsonTypeExtension>() {
return ::greptime::v1::JsonTypeExtension_descriptor();
}
PROTOBUF_NAMESPACE_CLOSE PROTOBUF_NAMESPACE_CLOSE
+118 -50
View File
@@ -204,6 +204,49 @@ func (ColumnDataType) EnumDescriptor() ([]byte, []int) {
return file_greptime_v1_common_proto_rawDescGZIP(), []int{1} return file_greptime_v1_common_proto_rawDescGZIP(), []int{1}
} }
type JsonTypeExtension int32
const (
JsonTypeExtension_JSON_BINARY JsonTypeExtension = 0
)
// Enum value maps for JsonTypeExtension.
var (
JsonTypeExtension_name = map[int32]string{
0: "JSON_BINARY",
}
JsonTypeExtension_value = map[string]int32{
"JSON_BINARY": 0,
}
)
func (x JsonTypeExtension) Enum() *JsonTypeExtension {
p := new(JsonTypeExtension)
*p = x
return p
}
func (x JsonTypeExtension) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (JsonTypeExtension) Descriptor() protoreflect.EnumDescriptor {
return file_greptime_v1_common_proto_enumTypes[2].Descriptor()
}
func (JsonTypeExtension) Type() protoreflect.EnumType {
return &file_greptime_v1_common_proto_enumTypes[2]
}
func (x JsonTypeExtension) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use JsonTypeExtension.Descriptor instead.
func (JsonTypeExtension) EnumDescriptor() ([]byte, []int) {
return file_greptime_v1_common_proto_rawDescGZIP(), []int{2}
}
type QueryContext struct { type QueryContext struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
@@ -1050,6 +1093,7 @@ type ColumnDataTypeExtension struct {
// Types that are assignable to TypeExt: // Types that are assignable to TypeExt:
// //
// *ColumnDataTypeExtension_DecimalType // *ColumnDataTypeExtension_DecimalType
// *ColumnDataTypeExtension_JsonType
TypeExt isColumnDataTypeExtension_TypeExt `protobuf_oneof:"type_ext"` TypeExt isColumnDataTypeExtension_TypeExt `protobuf_oneof:"type_ext"`
} }
@@ -1099,6 +1143,13 @@ func (x *ColumnDataTypeExtension) GetDecimalType() *DecimalTypeExtension {
return nil return nil
} }
func (x *ColumnDataTypeExtension) GetJsonType() JsonTypeExtension {
if x, ok := x.GetTypeExt().(*ColumnDataTypeExtension_JsonType); ok {
return x.JsonType
}
return JsonTypeExtension_JSON_BINARY
}
type isColumnDataTypeExtension_TypeExt interface { type isColumnDataTypeExtension_TypeExt interface {
isColumnDataTypeExtension_TypeExt() isColumnDataTypeExtension_TypeExt()
} }
@@ -1107,8 +1158,15 @@ type ColumnDataTypeExtension_DecimalType struct {
DecimalType *DecimalTypeExtension `protobuf:"bytes,1,opt,name=decimal_type,json=decimalType,proto3,oneof"` DecimalType *DecimalTypeExtension `protobuf:"bytes,1,opt,name=decimal_type,json=decimalType,proto3,oneof"`
} }
type ColumnDataTypeExtension_JsonType struct {
// Marks the binary column in proto is actually a JSON column.
JsonType JsonTypeExtension `protobuf:"varint,2,opt,name=json_type,json=jsonType,proto3,enum=greptime.v1.JsonTypeExtension,oneof"`
}
func (*ColumnDataTypeExtension_DecimalType) isColumnDataTypeExtension_TypeExt() {} func (*ColumnDataTypeExtension_DecimalType) isColumnDataTypeExtension_TypeExt() {}
func (*ColumnDataTypeExtension_JsonType) isColumnDataTypeExtension_TypeExt() {}
type DecimalTypeExtension struct { type DecimalTypeExtension struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
@@ -1329,13 +1387,17 @@ var file_greptime_v1_common_proto_rawDesc = []byte{
0x0b, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x22, 0x2c, 0x0a, 0x0a, 0x0b, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x22, 0x2c, 0x0a, 0x0a,
0x44, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x31, 0x32, 0x38, 0x12, 0x0e, 0x0a, 0x02, 0x68, 0x69, 0x44, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x31, 0x32, 0x38, 0x12, 0x0e, 0x0a, 0x02, 0x68, 0x69,
0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x68, 0x69, 0x12, 0x0e, 0x0a, 0x02, 0x6c, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x68, 0x69, 0x12, 0x0e, 0x0a, 0x02, 0x6c, 0x6f,
0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x6c, 0x6f, 0x22, 0x6d, 0x0a, 0x17, 0x43, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x6c, 0x6f, 0x22, 0xac, 0x01, 0x0a, 0x17, 0x43,
0x6c, 0x75, 0x6d, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x45, 0x78, 0x74, 0x65, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x45, 0x78, 0x74,
0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x46, 0x0a, 0x0c, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x46, 0x0a, 0x0c, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61,
0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x72, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67,
0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x63, 0x69, 0x6d,
0x6c, 0x54, 0x79, 0x70, 0x65, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x61, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x48,
0x52, 0x0b, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x42, 0x0a, 0x0a, 0x00, 0x52, 0x0b, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x3d,
0x0a, 0x09, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
0x0e, 0x32, 0x1e, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e,
0x4a, 0x73, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f,
0x6e, 0x48, 0x00, 0x52, 0x08, 0x6a, 0x73, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x42, 0x0a, 0x0a,
0x08, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x65, 0x78, 0x74, 0x22, 0x4a, 0x0a, 0x14, 0x44, 0x65, 0x63, 0x08, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x65, 0x78, 0x74, 0x22, 0x4a, 0x0a, 0x14, 0x44, 0x65, 0x63,
0x69, 0x6d, 0x61, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x69, 0x6d, 0x61, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f,
0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01,
@@ -1383,12 +1445,15 @@ var file_greptime_v1_common_proto_rawDesc = []byte{
0x49, 0x4d, 0x45, 0x10, 0x18, 0x12, 0x1b, 0x0a, 0x17, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x56, 0x41, 0x49, 0x4d, 0x45, 0x10, 0x18, 0x12, 0x1b, 0x0a, 0x17, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x56, 0x41,
0x4c, 0x5f, 0x4d, 0x4f, 0x4e, 0x54, 0x48, 0x5f, 0x44, 0x41, 0x59, 0x5f, 0x4e, 0x41, 0x4e, 0x4f, 0x4c, 0x5f, 0x4d, 0x4f, 0x4e, 0x54, 0x48, 0x5f, 0x44, 0x41, 0x59, 0x5f, 0x4e, 0x41, 0x4e, 0x4f,
0x10, 0x19, 0x12, 0x0e, 0x0a, 0x0a, 0x44, 0x45, 0x43, 0x49, 0x4d, 0x41, 0x4c, 0x31, 0x32, 0x38, 0x10, 0x19, 0x12, 0x0e, 0x0a, 0x0a, 0x44, 0x45, 0x43, 0x49, 0x4d, 0x41, 0x4c, 0x31, 0x32, 0x38,
0x10, 0x1e, 0x42, 0x4f, 0x0a, 0x0e, 0x69, 0x6f, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x10, 0x1e, 0x2a, 0x24, 0x0a, 0x11, 0x4a, 0x73, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x45, 0x78,
0x65, 0x2e, 0x76, 0x31, 0x42, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0f, 0x0a, 0x0b, 0x4a, 0x53, 0x4f, 0x4e, 0x5f,
0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x47, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x42, 0x49, 0x4e, 0x41, 0x52, 0x59, 0x10, 0x00, 0x42, 0x4f, 0x0a, 0x0e, 0x69, 0x6f, 0x2e, 0x67,
0x65, 0x54, 0x65, 0x61, 0x6d, 0x2f, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2d, 0x70, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x06, 0x43, 0x6f, 0x6d, 0x6d,
0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x6e, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x47,
0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x2f, 0x67, 0x72, 0x65, 0x70,
0x74, 0x69, 0x6d, 0x65, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x67, 0x72,
0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
} }
var ( var (
@@ -1403,48 +1468,50 @@ func file_greptime_v1_common_proto_rawDescGZIP() []byte {
return file_greptime_v1_common_proto_rawDescData return file_greptime_v1_common_proto_rawDescData
} }
var file_greptime_v1_common_proto_enumTypes = make([]protoimpl.EnumInfo, 2) var file_greptime_v1_common_proto_enumTypes = make([]protoimpl.EnumInfo, 3)
var file_greptime_v1_common_proto_msgTypes = make([]protoimpl.MessageInfo, 20) var file_greptime_v1_common_proto_msgTypes = make([]protoimpl.MessageInfo, 20)
var file_greptime_v1_common_proto_goTypes = []interface{}{ var file_greptime_v1_common_proto_goTypes = []interface{}{
(SemanticType)(0), // 0: greptime.v1.SemanticType (SemanticType)(0), // 0: greptime.v1.SemanticType
(ColumnDataType)(0), // 1: greptime.v1.ColumnDataType (ColumnDataType)(0), // 1: greptime.v1.ColumnDataType
(*QueryContext)(nil), // 2: greptime.v1.QueryContext (JsonTypeExtension)(0), // 2: greptime.v1.JsonTypeExtension
(*RequestHeader)(nil), // 3: greptime.v1.RequestHeader (*QueryContext)(nil), // 3: greptime.v1.QueryContext
(*ResponseHeader)(nil), // 4: greptime.v1.ResponseHeader (*RequestHeader)(nil), // 4: greptime.v1.RequestHeader
(*Status)(nil), // 5: greptime.v1.Status (*ResponseHeader)(nil), // 5: greptime.v1.ResponseHeader
(*AuthHeader)(nil), // 6: greptime.v1.AuthHeader (*Status)(nil), // 6: greptime.v1.Status
(*Basic)(nil), // 7: greptime.v1.Basic (*AuthHeader)(nil), // 7: greptime.v1.AuthHeader
(*Token)(nil), // 8: greptime.v1.Token (*Basic)(nil), // 8: greptime.v1.Basic
(*TableName)(nil), // 9: greptime.v1.TableName (*Token)(nil), // 9: greptime.v1.Token
(*AffectedRows)(nil), // 10: greptime.v1.AffectedRows (*TableName)(nil), // 10: greptime.v1.TableName
(*Metrics)(nil), // 11: greptime.v1.Metrics (*AffectedRows)(nil), // 11: greptime.v1.AffectedRows
(*ExpireAfter)(nil), // 12: greptime.v1.ExpireAfter (*Metrics)(nil), // 12: greptime.v1.Metrics
(*FlightMetadata)(nil), // 13: greptime.v1.FlightMetadata (*ExpireAfter)(nil), // 13: greptime.v1.ExpireAfter
(*IntervalMonthDayNano)(nil), // 14: greptime.v1.IntervalMonthDayNano (*FlightMetadata)(nil), // 14: greptime.v1.FlightMetadata
(*Decimal128)(nil), // 15: greptime.v1.Decimal128 (*IntervalMonthDayNano)(nil), // 15: greptime.v1.IntervalMonthDayNano
(*ColumnDataTypeExtension)(nil), // 16: greptime.v1.ColumnDataTypeExtension (*Decimal128)(nil), // 16: greptime.v1.Decimal128
(*DecimalTypeExtension)(nil), // 17: greptime.v1.DecimalTypeExtension (*ColumnDataTypeExtension)(nil), // 17: greptime.v1.ColumnDataTypeExtension
(*ColumnOptions)(nil), // 18: greptime.v1.ColumnOptions (*DecimalTypeExtension)(nil), // 18: greptime.v1.DecimalTypeExtension
nil, // 19: greptime.v1.QueryContext.ExtensionsEntry (*ColumnOptions)(nil), // 19: greptime.v1.ColumnOptions
nil, // 20: greptime.v1.RequestHeader.TracingContextEntry nil, // 20: greptime.v1.QueryContext.ExtensionsEntry
nil, // 21: greptime.v1.ColumnOptions.OptionsEntry nil, // 21: greptime.v1.RequestHeader.TracingContextEntry
nil, // 22: greptime.v1.ColumnOptions.OptionsEntry
} }
var file_greptime_v1_common_proto_depIdxs = []int32{ var file_greptime_v1_common_proto_depIdxs = []int32{
19, // 0: greptime.v1.QueryContext.extensions:type_name -> greptime.v1.QueryContext.ExtensionsEntry 20, // 0: greptime.v1.QueryContext.extensions:type_name -> greptime.v1.QueryContext.ExtensionsEntry
6, // 1: greptime.v1.RequestHeader.authorization:type_name -> greptime.v1.AuthHeader 7, // 1: greptime.v1.RequestHeader.authorization:type_name -> greptime.v1.AuthHeader
20, // 2: greptime.v1.RequestHeader.tracing_context:type_name -> greptime.v1.RequestHeader.TracingContextEntry 21, // 2: greptime.v1.RequestHeader.tracing_context:type_name -> greptime.v1.RequestHeader.TracingContextEntry
5, // 3: greptime.v1.ResponseHeader.status:type_name -> greptime.v1.Status 6, // 3: greptime.v1.ResponseHeader.status:type_name -> greptime.v1.Status
7, // 4: greptime.v1.AuthHeader.basic:type_name -> greptime.v1.Basic 8, // 4: greptime.v1.AuthHeader.basic:type_name -> greptime.v1.Basic
8, // 5: greptime.v1.AuthHeader.token:type_name -> greptime.v1.Token 9, // 5: greptime.v1.AuthHeader.token:type_name -> greptime.v1.Token
10, // 6: greptime.v1.FlightMetadata.affected_rows:type_name -> greptime.v1.AffectedRows 11, // 6: greptime.v1.FlightMetadata.affected_rows:type_name -> greptime.v1.AffectedRows
11, // 7: greptime.v1.FlightMetadata.metrics:type_name -> greptime.v1.Metrics 12, // 7: greptime.v1.FlightMetadata.metrics:type_name -> greptime.v1.Metrics
17, // 8: greptime.v1.ColumnDataTypeExtension.decimal_type:type_name -> greptime.v1.DecimalTypeExtension 18, // 8: greptime.v1.ColumnDataTypeExtension.decimal_type:type_name -> greptime.v1.DecimalTypeExtension
21, // 9: greptime.v1.ColumnOptions.options:type_name -> greptime.v1.ColumnOptions.OptionsEntry 2, // 9: greptime.v1.ColumnDataTypeExtension.json_type:type_name -> greptime.v1.JsonTypeExtension
10, // [10:10] is the sub-list for method output_type 22, // 10: greptime.v1.ColumnOptions.options:type_name -> greptime.v1.ColumnOptions.OptionsEntry
10, // [10:10] is the sub-list for method input_type 11, // [11:11] is the sub-list for method output_type
10, // [10:10] is the sub-list for extension type_name 11, // [11:11] is the sub-list for method input_type
10, // [10:10] is the sub-list for extension extendee 11, // [11:11] is the sub-list for extension type_name
0, // [0:10] is the sub-list for field type_name 11, // [11:11] is the sub-list for extension extendee
0, // [0:11] is the sub-list for field type_name
} }
func init() { file_greptime_v1_common_proto_init() } func init() { file_greptime_v1_common_proto_init() }
@@ -1664,13 +1731,14 @@ func file_greptime_v1_common_proto_init() {
} }
file_greptime_v1_common_proto_msgTypes[14].OneofWrappers = []interface{}{ file_greptime_v1_common_proto_msgTypes[14].OneofWrappers = []interface{}{
(*ColumnDataTypeExtension_DecimalType)(nil), (*ColumnDataTypeExtension_DecimalType)(nil),
(*ColumnDataTypeExtension_JsonType)(nil),
} }
type x struct{} type x struct{}
out := protoimpl.TypeBuilder{ out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{ File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_greptime_v1_common_proto_rawDesc, RawDescriptor: file_greptime_v1_common_proto_rawDesc,
NumEnums: 2, NumEnums: 3,
NumMessages: 20, NumMessages: 20,
NumExtensions: 0, NumExtensions: 0,
NumServices: 0, NumServices: 0,
+322 -24
View File
@@ -464,6 +464,105 @@ public final class Common {
// @@protoc_insertion_point(enum_scope:greptime.v1.ColumnDataType) // @@protoc_insertion_point(enum_scope:greptime.v1.ColumnDataType)
} }
/**
* Protobuf enum {@code greptime.v1.JsonTypeExtension}
*/
public enum JsonTypeExtension
implements com.google.protobuf.ProtocolMessageEnum {
/**
* <code>JSON_BINARY = 0;</code>
*/
JSON_BINARY(0),
UNRECOGNIZED(-1),
;
/**
* <code>JSON_BINARY = 0;</code>
*/
public static final int JSON_BINARY_VALUE = 0;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static JsonTypeExtension valueOf(int value) {
return forNumber(value);
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
*/
public static JsonTypeExtension forNumber(int value) {
switch (value) {
case 0: return JSON_BINARY;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap<JsonTypeExtension>
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
JsonTypeExtension> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap<JsonTypeExtension>() {
public JsonTypeExtension findValueByNumber(int number) {
return JsonTypeExtension.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalStateException(
"Can't get the descriptor of an unrecognized enum value.");
}
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return io.greptime.v1.Common.getDescriptor().getEnumTypes().get(2);
}
private static final JsonTypeExtension[] VALUES = values();
public static JsonTypeExtension valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private JsonTypeExtension(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:greptime.v1.JsonTypeExtension)
}
public interface QueryContextOrBuilder extends public interface QueryContextOrBuilder extends
// @@protoc_insertion_point(interface_extends:greptime.v1.QueryContext) // @@protoc_insertion_point(interface_extends:greptime.v1.QueryContext)
com.google.protobuf.MessageOrBuilder { com.google.protobuf.MessageOrBuilder {
@@ -11476,6 +11575,34 @@ java.lang.String defaultValue);
*/ */
io.greptime.v1.Common.DecimalTypeExtensionOrBuilder getDecimalTypeOrBuilder(); io.greptime.v1.Common.DecimalTypeExtensionOrBuilder getDecimalTypeOrBuilder();
/**
* <pre>
* Marks the binary column in proto is actually a JSON column.
* </pre>
*
* <code>.greptime.v1.JsonTypeExtension json_type = 2;</code>
* @return Whether the jsonType field is set.
*/
boolean hasJsonType();
/**
* <pre>
* Marks the binary column in proto is actually a JSON column.
* </pre>
*
* <code>.greptime.v1.JsonTypeExtension json_type = 2;</code>
* @return The enum numeric value on the wire for jsonType.
*/
int getJsonTypeValue();
/**
* <pre>
* Marks the binary column in proto is actually a JSON column.
* </pre>
*
* <code>.greptime.v1.JsonTypeExtension json_type = 2;</code>
* @return The jsonType.
*/
io.greptime.v1.Common.JsonTypeExtension getJsonType();
public io.greptime.v1.Common.ColumnDataTypeExtension.TypeExtCase getTypeExtCase(); public io.greptime.v1.Common.ColumnDataTypeExtension.TypeExtCase getTypeExtCase();
} }
/** /**
@@ -11541,6 +11668,12 @@ java.lang.String defaultValue);
typeExtCase_ = 1; typeExtCase_ = 1;
break; break;
} }
case 16: {
int rawValue = input.readEnum();
typeExtCase_ = 2;
typeExt_ = rawValue;
break;
}
default: { default: {
if (!parseUnknownField( if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) { input, unknownFields, extensionRegistry, tag)) {
@@ -11581,6 +11714,7 @@ java.lang.String defaultValue);
implements com.google.protobuf.Internal.EnumLite, implements com.google.protobuf.Internal.EnumLite,
com.google.protobuf.AbstractMessage.InternalOneOfEnum { com.google.protobuf.AbstractMessage.InternalOneOfEnum {
DECIMAL_TYPE(1), DECIMAL_TYPE(1),
JSON_TYPE(2),
TYPEEXT_NOT_SET(0); TYPEEXT_NOT_SET(0);
private final int value; private final int value;
private TypeExtCase(int value) { private TypeExtCase(int value) {
@@ -11599,6 +11733,7 @@ java.lang.String defaultValue);
public static TypeExtCase forNumber(int value) { public static TypeExtCase forNumber(int value) {
switch (value) { switch (value) {
case 1: return DECIMAL_TYPE; case 1: return DECIMAL_TYPE;
case 2: return JSON_TYPE;
case 0: return TYPEEXT_NOT_SET; case 0: return TYPEEXT_NOT_SET;
default: return null; default: return null;
} }
@@ -11645,6 +11780,50 @@ java.lang.String defaultValue);
return io.greptime.v1.Common.DecimalTypeExtension.getDefaultInstance(); return io.greptime.v1.Common.DecimalTypeExtension.getDefaultInstance();
} }
public static final int JSON_TYPE_FIELD_NUMBER = 2;
/**
* <pre>
* Marks the binary column in proto is actually a JSON column.
* </pre>
*
* <code>.greptime.v1.JsonTypeExtension json_type = 2;</code>
* @return Whether the jsonType field is set.
*/
public boolean hasJsonType() {
return typeExtCase_ == 2;
}
/**
* <pre>
* Marks the binary column in proto is actually a JSON column.
* </pre>
*
* <code>.greptime.v1.JsonTypeExtension json_type = 2;</code>
* @return The enum numeric value on the wire for jsonType.
*/
public int getJsonTypeValue() {
if (typeExtCase_ == 2) {
return (java.lang.Integer) typeExt_;
}
return 0;
}
/**
* <pre>
* Marks the binary column in proto is actually a JSON column.
* </pre>
*
* <code>.greptime.v1.JsonTypeExtension json_type = 2;</code>
* @return The jsonType.
*/
public io.greptime.v1.Common.JsonTypeExtension getJsonType() {
if (typeExtCase_ == 2) {
@SuppressWarnings("deprecation")
io.greptime.v1.Common.JsonTypeExtension result = io.greptime.v1.Common.JsonTypeExtension.valueOf(
(java.lang.Integer) typeExt_);
return result == null ? io.greptime.v1.Common.JsonTypeExtension.UNRECOGNIZED : result;
}
return io.greptime.v1.Common.JsonTypeExtension.JSON_BINARY;
}
private byte memoizedIsInitialized = -1; private byte memoizedIsInitialized = -1;
@java.lang.Override @java.lang.Override
public final boolean isInitialized() { public final boolean isInitialized() {
@@ -11662,6 +11841,9 @@ java.lang.String defaultValue);
if (typeExtCase_ == 1) { if (typeExtCase_ == 1) {
output.writeMessage(1, (io.greptime.v1.Common.DecimalTypeExtension) typeExt_); output.writeMessage(1, (io.greptime.v1.Common.DecimalTypeExtension) typeExt_);
} }
if (typeExtCase_ == 2) {
output.writeEnum(2, ((java.lang.Integer) typeExt_));
}
unknownFields.writeTo(output); unknownFields.writeTo(output);
} }
@@ -11675,6 +11857,10 @@ java.lang.String defaultValue);
size += com.google.protobuf.CodedOutputStream size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, (io.greptime.v1.Common.DecimalTypeExtension) typeExt_); .computeMessageSize(1, (io.greptime.v1.Common.DecimalTypeExtension) typeExt_);
} }
if (typeExtCase_ == 2) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(2, ((java.lang.Integer) typeExt_));
}
size += unknownFields.getSerializedSize(); size += unknownFields.getSerializedSize();
memoizedSize = size; memoizedSize = size;
return size; return size;
@@ -11696,6 +11882,10 @@ java.lang.String defaultValue);
if (!getDecimalType() if (!getDecimalType()
.equals(other.getDecimalType())) return false; .equals(other.getDecimalType())) return false;
break; break;
case 2:
if (getJsonTypeValue()
!= other.getJsonTypeValue()) return false;
break;
case 0: case 0:
default: default:
} }
@@ -11715,6 +11905,10 @@ java.lang.String defaultValue);
hash = (37 * hash) + DECIMAL_TYPE_FIELD_NUMBER; hash = (37 * hash) + DECIMAL_TYPE_FIELD_NUMBER;
hash = (53 * hash) + getDecimalType().hashCode(); hash = (53 * hash) + getDecimalType().hashCode();
break; break;
case 2:
hash = (37 * hash) + JSON_TYPE_FIELD_NUMBER;
hash = (53 * hash) + getJsonTypeValue();
break;
case 0: case 0:
default: default:
} }
@@ -11890,6 +12084,9 @@ java.lang.String defaultValue);
result.typeExt_ = decimalTypeBuilder_.build(); result.typeExt_ = decimalTypeBuilder_.build();
} }
} }
if (typeExtCase_ == 2) {
result.typeExt_ = typeExt_;
}
result.typeExtCase_ = typeExtCase_; result.typeExtCase_ = typeExtCase_;
onBuilt(); onBuilt();
return result; return result;
@@ -11944,6 +12141,10 @@ java.lang.String defaultValue);
mergeDecimalType(other.getDecimalType()); mergeDecimalType(other.getDecimalType());
break; break;
} }
case JSON_TYPE: {
setJsonTypeValue(other.getJsonTypeValue());
break;
}
case TYPEEXT_NOT_SET: { case TYPEEXT_NOT_SET: {
break; break;
} }
@@ -12133,6 +12334,101 @@ java.lang.String defaultValue);
onChanged();; onChanged();;
return decimalTypeBuilder_; return decimalTypeBuilder_;
} }
/**
* <pre>
* Marks the binary column in proto is actually a JSON column.
* </pre>
*
* <code>.greptime.v1.JsonTypeExtension json_type = 2;</code>
* @return Whether the jsonType field is set.
*/
@java.lang.Override
public boolean hasJsonType() {
return typeExtCase_ == 2;
}
/**
* <pre>
* Marks the binary column in proto is actually a JSON column.
* </pre>
*
* <code>.greptime.v1.JsonTypeExtension json_type = 2;</code>
* @return The enum numeric value on the wire for jsonType.
*/
@java.lang.Override
public int getJsonTypeValue() {
if (typeExtCase_ == 2) {
return ((java.lang.Integer) typeExt_).intValue();
}
return 0;
}
/**
* <pre>
* Marks the binary column in proto is actually a JSON column.
* </pre>
*
* <code>.greptime.v1.JsonTypeExtension json_type = 2;</code>
* @param value The enum numeric value on the wire for jsonType to set.
* @return This builder for chaining.
*/
public Builder setJsonTypeValue(int value) {
typeExtCase_ = 2;
typeExt_ = value;
onChanged();
return this;
}
/**
* <pre>
* Marks the binary column in proto is actually a JSON column.
* </pre>
*
* <code>.greptime.v1.JsonTypeExtension json_type = 2;</code>
* @return The jsonType.
*/
@java.lang.Override
public io.greptime.v1.Common.JsonTypeExtension getJsonType() {
if (typeExtCase_ == 2) {
@SuppressWarnings("deprecation")
io.greptime.v1.Common.JsonTypeExtension result = io.greptime.v1.Common.JsonTypeExtension.valueOf(
(java.lang.Integer) typeExt_);
return result == null ? io.greptime.v1.Common.JsonTypeExtension.UNRECOGNIZED : result;
}
return io.greptime.v1.Common.JsonTypeExtension.JSON_BINARY;
}
/**
* <pre>
* Marks the binary column in proto is actually a JSON column.
* </pre>
*
* <code>.greptime.v1.JsonTypeExtension json_type = 2;</code>
* @param value The jsonType to set.
* @return This builder for chaining.
*/
public Builder setJsonType(io.greptime.v1.Common.JsonTypeExtension value) {
if (value == null) {
throw new NullPointerException();
}
typeExtCase_ = 2;
typeExt_ = value.getNumber();
onChanged();
return this;
}
/**
* <pre>
* Marks the binary column in proto is actually a JSON column.
* </pre>
*
* <code>.greptime.v1.JsonTypeExtension json_type = 2;</code>
* @return This builder for chaining.
*/
public Builder clearJsonType() {
if (typeExtCase_ == 2) {
typeExtCase_ = 0;
typeExt_ = null;
onChanged();
}
return this;
}
@java.lang.Override @java.lang.Override
public final Builder setUnknownFields( public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) { final com.google.protobuf.UnknownFieldSet unknownFields) {
@@ -13925,29 +14221,31 @@ java.lang.String defaultValue);
"2\024.greptime.v1.Metrics\"I\n\024IntervalMonthD" + "2\024.greptime.v1.Metrics\"I\n\024IntervalMonthD" +
"ayNano\022\016\n\006months\030\001 \001(\005\022\014\n\004days\030\002 \001(\005\022\023\n\013" + "ayNano\022\016\n\006months\030\001 \001(\005\022\014\n\004days\030\002 \001(\005\022\023\n\013" +
"nanoseconds\030\003 \001(\003\"$\n\nDecimal128\022\n\n\002hi\030\001 " + "nanoseconds\030\003 \001(\003\"$\n\nDecimal128\022\n\n\002hi\030\001 " +
"\001(\003\022\n\n\002lo\030\002 \001(\003\"`\n\027ColumnDataTypeExtensi" + "\001(\003\022\n\n\002lo\030\002 \001(\003\"\225\001\n\027ColumnDataTypeExtens" +
"on\0229\n\014decimal_type\030\001 \001(\0132!.greptime.v1.D" + "ion\0229\n\014decimal_type\030\001 \001(\0132!.greptime.v1." +
"ecimalTypeExtensionH\000B\n\n\010type_ext\"8\n\024Dec" + "DecimalTypeExtensionH\000\0223\n\tjson_type\030\002 \001(" +
"imalTypeExtension\022\021\n\tprecision\030\001 \001(\005\022\r\n\005" + "\0162\036.greptime.v1.JsonTypeExtensionH\000B\n\n\010t" +
"scale\030\002 \001(\005\"y\n\rColumnOptions\0228\n\007options\030" + "ype_ext\"8\n\024DecimalTypeExtension\022\021\n\tpreci" +
"\001 \003(\0132\'.greptime.v1.ColumnOptions.Option" + "sion\030\001 \001(\005\022\r\n\005scale\030\002 \001(\005\"y\n\rColumnOptio" +
"sEntry\032.\n\014OptionsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005v" + "ns\0228\n\007options\030\001 \003(\0132\'.greptime.v1.Column" +
"alue\030\002 \001(\t:\0028\001*1\n\014SemanticType\022\007\n\003TAG\020\000\022" + "Options.OptionsEntry\032.\n\014OptionsEntry\022\013\n\003" +
"\t\n\005FIELD\020\001\022\r\n\tTIMESTAMP\020\002*\326\003\n\016ColumnData" + "key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001*1\n\014Semantic" +
"Type\022\013\n\007BOOLEAN\020\000\022\010\n\004INT8\020\001\022\t\n\005INT16\020\002\022\t" + "Type\022\007\n\003TAG\020\000\022\t\n\005FIELD\020\001\022\r\n\tTIMESTAMP\020\002*" +
"\n\005INT32\020\003\022\t\n\005INT64\020\004\022\t\n\005UINT8\020\005\022\n\n\006UINT1" + "\326\003\n\016ColumnDataType\022\013\n\007BOOLEAN\020\000\022\010\n\004INT8\020" +
"6\020\006\022\n\n\006UINT32\020\007\022\n\n\006UINT64\020\010\022\013\n\007FLOAT32\020\t" + "\001\022\t\n\005INT16\020\002\022\t\n\005INT32\020\003\022\t\n\005INT64\020\004\022\t\n\005UI" +
"\022\013\n\007FLOAT64\020\n\022\n\n\006BINARY\020\013\022\n\n\006STRING\020\014\022\010\n" + "NT8\020\005\022\n\n\006UINT16\020\006\022\n\n\006UINT32\020\007\022\n\n\006UINT64\020" +
"\004DATE\020\r\022\014\n\010DATETIME\020\016\022\024\n\020TIMESTAMP_SECON" + "\010\022\013\n\007FLOAT32\020\t\022\013\n\007FLOAT64\020\n\022\n\n\006BINARY\020\013\022" +
"D\020\017\022\031\n\025TIMESTAMP_MILLISECOND\020\020\022\031\n\025TIMEST" + "\n\n\006STRING\020\014\022\010\n\004DATE\020\r\022\014\n\010DATETIME\020\016\022\024\n\020T" +
"AMP_MICROSECOND\020\021\022\030\n\024TIMESTAMP_NANOSECON" + "IMESTAMP_SECOND\020\017\022\031\n\025TIMESTAMP_MILLISECO" +
"D\020\022\022\017\n\013TIME_SECOND\020\023\022\024\n\020TIME_MILLISECOND" + "ND\020\020\022\031\n\025TIMESTAMP_MICROSECOND\020\021\022\030\n\024TIMES" +
"\020\024\022\024\n\020TIME_MICROSECOND\020\025\022\023\n\017TIME_NANOSEC" + "TAMP_NANOSECOND\020\022\022\017\n\013TIME_SECOND\020\023\022\024\n\020TI" +
"OND\020\026\022\027\n\023INTERVAL_YEAR_MONTH\020\027\022\025\n\021INTERV" + "ME_MILLISECOND\020\024\022\024\n\020TIME_MICROSECOND\020\025\022\023" +
"AL_DAY_TIME\020\030\022\033\n\027INTERVAL_MONTH_DAY_NANO" + "\n\017TIME_NANOSECOND\020\026\022\027\n\023INTERVAL_YEAR_MON" +
"\020\031\022\016\n\nDECIMAL128\020\036BO\n\016io.greptime.v1B\006Co" + "TH\020\027\022\025\n\021INTERVAL_DAY_TIME\020\030\022\033\n\027INTERVAL_" +
"mmonZ5github.com/GreptimeTeam/greptime-p" + "MONTH_DAY_NANO\020\031\022\016\n\nDECIMAL128\020\036*$\n\021Json" +
"roto/go/greptime/v1b\006proto3" "TypeExtension\022\017\n\013JSON_BINARY\020\000BO\n\016io.gre" +
"ptime.v1B\006CommonZ5github.com/GreptimeTea" +
"m/greptime-proto/go/greptime/v1b\006proto3"
}; };
descriptor = com.google.protobuf.Descriptors.FileDescriptor descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData, .internalBuildGeneratedFileFrom(descriptorData,
@@ -14054,7 +14352,7 @@ java.lang.String defaultValue);
internal_static_greptime_v1_ColumnDataTypeExtension_fieldAccessorTable = new internal_static_greptime_v1_ColumnDataTypeExtension_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_greptime_v1_ColumnDataTypeExtension_descriptor, internal_static_greptime_v1_ColumnDataTypeExtension_descriptor,
new java.lang.String[] { "DecimalType", "TypeExt", }); new java.lang.String[] { "DecimalType", "JsonType", "TypeExt", });
internal_static_greptime_v1_DecimalTypeExtension_descriptor = internal_static_greptime_v1_DecimalTypeExtension_descriptor =
getDescriptor().getMessageTypes().get(15); getDescriptor().getMessageTypes().get(15);
internal_static_greptime_v1_DecimalTypeExtension_fieldAccessorTable = new internal_static_greptime_v1_DecimalTypeExtension_fieldAccessorTable = new
+9 -1
View File
@@ -133,7 +133,11 @@ message Decimal128 {
// Type extension for some complex types // Type extension for some complex types
message ColumnDataTypeExtension { message ColumnDataTypeExtension {
oneof type_ext { DecimalTypeExtension decimal_type = 1; } oneof type_ext {
DecimalTypeExtension decimal_type = 1;
// Marks the binary column in proto is actually a JSON column.
JsonTypeExtension json_type = 2;
}
} }
message DecimalTypeExtension { message DecimalTypeExtension {
@@ -141,6 +145,10 @@ message DecimalTypeExtension {
int32 scale = 2; int32 scale = 2;
} }
enum JsonTypeExtension {
JSON_BINARY = 0;
}
// Additional options for the column. // Additional options for the column.
message ColumnOptions { message ColumnOptions {
// Supported keys: // Supported keys: