From ba1760f87bb8b8b92a52529d79fd0df5e45cbe06 Mon Sep 17 00:00:00 2001 From: CookiePieWw Date: Wed, 28 Aug 2024 00:33:10 +0800 Subject: [PATCH] feat: add json column type --- c++/greptime/v1/column.pb.cc | 52 ++++- c++/greptime/v1/column.pb.h | 101 ++++++++++ c++/greptime/v1/common.pb.cc | 11 +- c++/greptime/v1/common.pb.h | 3 +- c++/greptime/v1/row.pb.cc | 46 ++++- c++/greptime/v1/row.pb.h | 99 +++++++++ go/greptime/v1/column.pb.go | 28 ++- go/greptime/v1/common.pb.go | 18 +- go/greptime/v1/row.pb.go | 35 +++- .../src/main/java/io/greptime/v1/Columns.java | 190 +++++++++++++++++- java/src/main/java/io/greptime/v1/Common.java | 17 +- .../src/main/java/io/greptime/v1/RowData.java | 118 ++++++++++- proto/greptime/v1/column.proto | 1 + proto/greptime/v1/common.proto | 1 + proto/greptime/v1/row.proto | 1 + 15 files changed, 661 insertions(+), 60 deletions(-) diff --git a/c++/greptime/v1/column.pb.cc b/c++/greptime/v1/column.pb.cc index e7e33c8e..8bf4dc14 100644 --- a/c++/greptime/v1/column.pb.cc +++ b/c++/greptime/v1/column.pb.cc @@ -71,6 +71,7 @@ PROTOBUF_CONSTEXPR Column_Values::Column_Values( , /*decltype(_impl_._interval_day_time_values_cached_byte_size_)*/{0} , /*decltype(_impl_.interval_month_day_nano_values_)*/{} , /*decltype(_impl_.decimal128_values_)*/{} + , /*decltype(_impl_.json_values_)*/{} , /*decltype(_impl_._cached_size_)*/{}} {} struct Column_ValuesDefaultTypeInternal { PROTOBUF_CONSTEXPR Column_ValuesDefaultTypeInternal() @@ -140,6 +141,7 @@ const uint32_t TableStruct_greptime_2fv1_2fcolumn_2eproto::offsets[] PROTOBUF_SE PROTOBUF_FIELD_OFFSET(::greptime::v1::Column_Values, _impl_.interval_day_time_values_), PROTOBUF_FIELD_OFFSET(::greptime::v1::Column_Values, _impl_.interval_month_day_nano_values_), PROTOBUF_FIELD_OFFSET(::greptime::v1::Column_Values, _impl_.decimal128_values_), + PROTOBUF_FIELD_OFFSET(::greptime::v1::Column_Values, _impl_.json_values_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::greptime::v1::Column, _internal_metadata_), ~0u, // no _extensions_ @@ -156,7 +158,7 @@ const uint32_t TableStruct_greptime_2fv1_2fcolumn_2eproto::offsets[] PROTOBUF_SE }; static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { { 0, -1, -1, sizeof(::greptime::v1::Column_Values)}, - { 33, -1, -1, sizeof(::greptime::v1::Column)}, + { 34, -1, -1, sizeof(::greptime::v1::Column)}, }; static const ::_pb::Message* const file_default_instances[] = { @@ -166,7 +168,7 @@ static const ::_pb::Message* const file_default_instances[] = { const char descriptor_table_protodef_greptime_2fv1_2fcolumn_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = "\n\030greptime/v1/column.proto\022\013greptime.v1\032" - "\030greptime/v1/common.proto\"\303\010\n\006Column\022\023\n\013" + "\030greptime/v1/common.proto\"\330\010\n\006Column\022\023\n\013" "column_name\030\001 \001(\t\0220\n\rsemantic_type\030\002 \001(\016" "2\031.greptime.v1.SemanticType\022*\n\006values\030\003 " "\001(\0132\032.greptime.v1.Column.Values\022\021\n\tnull_" @@ -174,7 +176,7 @@ const char descriptor_table_protodef_greptime_2fv1_2fcolumn_2eproto[] PROTOBUF_S "v1.ColumnDataType\022@\n\022datatype_extension\030" "\006 \001(\0132$.greptime.v1.ColumnDataTypeExtens" "ion\022+\n\007options\030\007 \001(\0132\032.greptime.v1.Colum" - "nOptions\032\224\006\n\006Values\022\021\n\ti8_values\030\001 \003(\005\022\022" + "nOptions\032\251\006\n\006Values\022\021\n\ti8_values\030\001 \003(\005\022\022" "\n\ni16_values\030\002 \003(\005\022\022\n\ni32_values\030\003 \003(\005\022\022" "\n\ni64_values\030\004 \003(\003\022\021\n\tu8_values\030\005 \003(\r\022\022\n" "\nu16_values\030\006 \003(\r\022\022\n\nu32_values\030\007 \003(\r\022\022\n" @@ -193,17 +195,17 @@ const char descriptor_table_protodef_greptime_2fv1_2fcolumn_2eproto[] PROTOBUF_S "\n\030interval_day_time_values\030\031 \003(\003\022I\n\036inte" "rval_month_day_nano_values\030\032 \003(\0132!.grept" "ime.v1.IntervalMonthDayNano\0222\n\021decimal12" - "8_values\030\037 \003(\0132\027.greptime.v1.Decimal128B" - "P\n\016io.greptime.v1B\007ColumnsZ5github.com/G" - "reptimeTeam/greptime-proto/go/greptime/v" - "1b\006proto3" + "8_values\030\037 \003(\0132\027.greptime.v1.Decimal128\022" + "\023\n\013json_values\030 \003(\014BP\n\016io.greptime.v1B\007" + "ColumnsZ5github.com/GreptimeTeam/greptim" + "e-proto/go/greptime/v1b\006proto3" ; static const ::_pbi::DescriptorTable* const descriptor_table_greptime_2fv1_2fcolumn_2eproto_deps[1] = { &::descriptor_table_greptime_2fv1_2fcommon_2eproto, }; static ::_pbi::once_flag descriptor_table_greptime_2fv1_2fcolumn_2eproto_once; const ::_pbi::DescriptorTable descriptor_table_greptime_2fv1_2fcolumn_2eproto = { - false, false, 1249, descriptor_table_protodef_greptime_2fv1_2fcolumn_2eproto, + false, false, 1270, descriptor_table_protodef_greptime_2fv1_2fcolumn_2eproto, "greptime/v1/column.proto", &descriptor_table_greptime_2fv1_2fcolumn_2eproto_once, descriptor_table_greptime_2fv1_2fcolumn_2eproto_deps, 1, 2, schemas, file_default_instances, TableStruct_greptime_2fv1_2fcolumn_2eproto::offsets, @@ -288,6 +290,7 @@ Column_Values::Column_Values(const Column_Values& from) , /*decltype(_impl_._interval_day_time_values_cached_byte_size_)*/{0} , decltype(_impl_.interval_month_day_nano_values_){from._impl_.interval_month_day_nano_values_} , decltype(_impl_.decimal128_values_){from._impl_.decimal128_values_} + , decltype(_impl_.json_values_){from._impl_.json_values_} , /*decltype(_impl_._cached_size_)*/{}}; _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); @@ -346,6 +349,7 @@ inline void Column_Values::SharedCtor( , /*decltype(_impl_._interval_day_time_values_cached_byte_size_)*/{0} , decltype(_impl_.interval_month_day_nano_values_){arena} , decltype(_impl_.decimal128_values_){arena} + , decltype(_impl_.json_values_){arena} , /*decltype(_impl_._cached_size_)*/{} }; } @@ -388,6 +392,7 @@ inline void Column_Values::SharedDtor() { _impl_.interval_day_time_values_.~RepeatedField(); _impl_.interval_month_day_nano_values_.~RepeatedPtrField(); _impl_.decimal128_values_.~RepeatedPtrField(); + _impl_.json_values_.~RepeatedPtrField(); } void Column_Values::SetCachedSize(int size) const { @@ -427,6 +432,7 @@ void Column_Values::Clear() { _impl_.interval_day_time_values_.Clear(); _impl_.interval_month_day_nano_values_.Clear(); _impl_.decimal128_values_.Clear(); + _impl_.json_values_.Clear(); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } @@ -744,6 +750,20 @@ const char* Column_Values::_InternalParse(const char* ptr, ::_pbi::ParseContext* } else goto handle_unusual; continue; + // repeated bytes json_values = 32; + case 32: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 2)) { + ptr -= 2; + do { + ptr += 2; + auto str = _internal_add_json_values(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<258>(ptr)); + } else + goto handle_unusual; + continue; default: goto handle_unusual; } // switch @@ -1000,6 +1020,12 @@ uint8_t* Column_Values::_InternalSerialize( InternalWriteMessage(31, repfield, repfield.GetCachedSize(), target, stream); } + // repeated bytes json_values = 32; + for (int i = 0, n = this->_internal_json_values_size(); i < n; i++) { + const auto& s = this->_internal_json_values(i); + target = stream->WriteBytes(32, s, target); + } + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); @@ -1359,6 +1385,14 @@ size_t Column_Values::ByteSizeLong() const { ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); } + // repeated bytes json_values = 32; + total_size += 2 * + ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.json_values_.size()); + for (int i = 0, n = _impl_.json_values_.size(); i < n; i++) { + total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + _impl_.json_values_.Get(i)); + } + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } @@ -1404,6 +1438,7 @@ void Column_Values::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const :: _this->_impl_.interval_day_time_values_.MergeFrom(from._impl_.interval_day_time_values_); _this->_impl_.interval_month_day_nano_values_.MergeFrom(from._impl_.interval_month_day_nano_values_); _this->_impl_.decimal128_values_.MergeFrom(from._impl_.decimal128_values_); + _this->_impl_.json_values_.MergeFrom(from._impl_.json_values_); _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } @@ -1448,6 +1483,7 @@ void Column_Values::InternalSwap(Column_Values* other) { _impl_.interval_day_time_values_.InternalSwap(&other->_impl_.interval_day_time_values_); _impl_.interval_month_day_nano_values_.InternalSwap(&other->_impl_.interval_month_day_nano_values_); _impl_.decimal128_values_.InternalSwap(&other->_impl_.decimal128_values_); + _impl_.json_values_.InternalSwap(&other->_impl_.json_values_); } ::PROTOBUF_NAMESPACE_ID::Metadata Column_Values::GetMetadata() const { diff --git a/c++/greptime/v1/column.pb.h b/c++/greptime/v1/column.pb.h index 1af43865..868fad1d 100644 --- a/c++/greptime/v1/column.pb.h +++ b/c++/greptime/v1/column.pb.h @@ -212,6 +212,7 @@ class Column_Values final : kIntervalDayTimeValuesFieldNumber = 25, kIntervalMonthDayNanoValuesFieldNumber = 26, kDecimal128ValuesFieldNumber = 31, + kJsonValuesFieldNumber = 32, }; // repeated int32 i8_values = 1; int i8_values_size() const; @@ -803,6 +804,30 @@ class Column_Values final : const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::greptime::v1::Decimal128 >& decimal128_values() const; + // repeated bytes json_values = 32; + int json_values_size() const; + private: + int _internal_json_values_size() const; + public: + void clear_json_values(); + const std::string& json_values(int index) const; + std::string* mutable_json_values(int index); + void set_json_values(int index, const std::string& value); + void set_json_values(int index, std::string&& value); + void set_json_values(int index, const char* value); + void set_json_values(int index, const void* value, size_t size); + std::string* add_json_values(); + void add_json_values(const std::string& value); + void add_json_values(std::string&& value); + void add_json_values(const char* value); + void add_json_values(const void* value, size_t size); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& json_values() const; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_json_values(); + private: + const std::string& _internal_json_values(int index) const; + std::string* _internal_add_json_values(); + public: + // @@protoc_insertion_point(class_scope:greptime.v1.Column.Values) private: class _Internal; @@ -858,6 +883,7 @@ class Column_Values final : mutable std::atomic _interval_day_time_values_cached_byte_size_; ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::greptime::v1::IntervalMonthDayNano > interval_month_day_nano_values_; ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::greptime::v1::Decimal128 > decimal128_values_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField json_values_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; }; union { Impl_ _impl_; }; @@ -2432,6 +2458,81 @@ Column_Values::decimal128_values() const { return _impl_.decimal128_values_; } +// repeated bytes json_values = 32; +inline int Column_Values::_internal_json_values_size() const { + return _impl_.json_values_.size(); +} +inline int Column_Values::json_values_size() const { + return _internal_json_values_size(); +} +inline void Column_Values::clear_json_values() { + _impl_.json_values_.Clear(); +} +inline std::string* Column_Values::add_json_values() { + std::string* _s = _internal_add_json_values(); + // @@protoc_insertion_point(field_add_mutable:greptime.v1.Column.Values.json_values) + return _s; +} +inline const std::string& Column_Values::_internal_json_values(int index) const { + return _impl_.json_values_.Get(index); +} +inline const std::string& Column_Values::json_values(int index) const { + // @@protoc_insertion_point(field_get:greptime.v1.Column.Values.json_values) + return _internal_json_values(index); +} +inline std::string* Column_Values::mutable_json_values(int index) { + // @@protoc_insertion_point(field_mutable:greptime.v1.Column.Values.json_values) + return _impl_.json_values_.Mutable(index); +} +inline void Column_Values::set_json_values(int index, const std::string& value) { + _impl_.json_values_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set:greptime.v1.Column.Values.json_values) +} +inline void Column_Values::set_json_values(int index, std::string&& value) { + _impl_.json_values_.Mutable(index)->assign(std::move(value)); + // @@protoc_insertion_point(field_set:greptime.v1.Column.Values.json_values) +} +inline void Column_Values::set_json_values(int index, const char* value) { + GOOGLE_DCHECK(value != nullptr); + _impl_.json_values_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:greptime.v1.Column.Values.json_values) +} +inline void Column_Values::set_json_values(int index, const void* value, size_t size) { + _impl_.json_values_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:greptime.v1.Column.Values.json_values) +} +inline std::string* Column_Values::_internal_add_json_values() { + return _impl_.json_values_.Add(); +} +inline void Column_Values::add_json_values(const std::string& value) { + _impl_.json_values_.Add()->assign(value); + // @@protoc_insertion_point(field_add:greptime.v1.Column.Values.json_values) +} +inline void Column_Values::add_json_values(std::string&& value) { + _impl_.json_values_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:greptime.v1.Column.Values.json_values) +} +inline void Column_Values::add_json_values(const char* value) { + GOOGLE_DCHECK(value != nullptr); + _impl_.json_values_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:greptime.v1.Column.Values.json_values) +} +inline void Column_Values::add_json_values(const void* value, size_t size) { + _impl_.json_values_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:greptime.v1.Column.Values.json_values) +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& +Column_Values::json_values() const { + // @@protoc_insertion_point(field_list:greptime.v1.Column.Values.json_values) + return _impl_.json_values_; +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* +Column_Values::mutable_json_values() { + // @@protoc_insertion_point(field_mutable_list:greptime.v1.Column.Values.json_values) + return &_impl_.json_values_; +} + // ------------------------------------------------------------------- // Column diff --git a/c++/greptime/v1/common.pb.cc b/c++/greptime/v1/common.pb.cc index d8b73511..d387e15e 100644 --- a/c++/greptime/v1/common.pb.cc +++ b/c++/greptime/v1/common.pb.cc @@ -558,7 +558,7 @@ const char descriptor_table_protodef_greptime_2fv1_2fcommon_2eproto[] PROTOBUF_S "\001 \003(\0132\'.greptime.v1.ColumnOptions.Option" "sEntry\032.\n\014OptionsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005v" "alue\030\002 \001(\t:\0028\001*1\n\014SemanticType\022\007\n\003TAG\020\000\022" - "\t\n\005FIELD\020\001\022\r\n\tTIMESTAMP\020\002*\326\003\n\016ColumnData" + "\t\n\005FIELD\020\001\022\r\n\tTIMESTAMP\020\002*\340\003\n\016ColumnData" "Type\022\013\n\007BOOLEAN\020\000\022\010\n\004INT8\020\001\022\t\n\005INT16\020\002\022\t" "\n\005INT32\020\003\022\t\n\005INT64\020\004\022\t\n\005UINT8\020\005\022\n\n\006UINT1" "6\020\006\022\n\n\006UINT32\020\007\022\n\n\006UINT64\020\010\022\013\n\007FLOAT32\020\t" @@ -570,13 +570,13 @@ const char descriptor_table_protodef_greptime_2fv1_2fcommon_2eproto[] PROTOBUF_S "\020\024\022\024\n\020TIME_MICROSECOND\020\025\022\023\n\017TIME_NANOSEC" "OND\020\026\022\027\n\023INTERVAL_YEAR_MONTH\020\027\022\025\n\021INTERV" "AL_DAY_TIME\020\030\022\033\n\027INTERVAL_MONTH_DAY_NANO" - "\020\031\022\016\n\nDECIMAL128\020\036BO\n\016io.greptime.v1B\006Co" - "mmonZ5github.com/GreptimeTeam/greptime-p" - "roto/go/greptime/v1b\006proto3" + "\020\031\022\016\n\nDECIMAL128\020\036\022\010\n\004JSON\020\037BO\n\016io.grept" + "ime.v1B\006CommonZ5github.com/GreptimeTeam/" + "greptime-proto/go/greptime/v1b\006proto3" ; static ::_pbi::once_flag descriptor_table_greptime_2fv1_2fcommon_2eproto_once; const ::_pbi::DescriptorTable descriptor_table_greptime_2fv1_2fcommon_2eproto = { - false, false, 2067, descriptor_table_protodef_greptime_2fv1_2fcommon_2eproto, + false, false, 2077, descriptor_table_protodef_greptime_2fv1_2fcommon_2eproto, "greptime/v1/common.proto", &descriptor_table_greptime_2fv1_2fcommon_2eproto_once, nullptr, 0, 20, schemas, file_default_instances, TableStruct_greptime_2fv1_2fcommon_2eproto::offsets, @@ -639,6 +639,7 @@ bool ColumnDataType_IsValid(int value) { case 24: case 25: case 30: + case 31: return true; default: return false; diff --git a/c++/greptime/v1/common.pb.h b/c++/greptime/v1/common.pb.h index ded265d5..db05e11c 100644 --- a/c++/greptime/v1/common.pb.h +++ b/c++/greptime/v1/common.pb.h @@ -191,12 +191,13 @@ enum ColumnDataType : int { INTERVAL_DAY_TIME = 24, INTERVAL_MONTH_DAY_NANO = 25, DECIMAL128 = 30, + JSON = 31, ColumnDataType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), ColumnDataType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; bool ColumnDataType_IsValid(int value); constexpr ColumnDataType ColumnDataType_MIN = BOOLEAN; -constexpr ColumnDataType ColumnDataType_MAX = DECIMAL128; +constexpr ColumnDataType ColumnDataType_MAX = JSON; constexpr int ColumnDataType_ARRAYSIZE = ColumnDataType_MAX + 1; const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ColumnDataType_descriptor(); diff --git a/c++/greptime/v1/row.pb.cc b/c++/greptime/v1/row.pb.cc index c596e1dd..f41ace9e 100644 --- a/c++/greptime/v1/row.pb.cc +++ b/c++/greptime/v1/row.pb.cc @@ -146,6 +146,7 @@ const uint32_t TableStruct_greptime_2fv1_2frow_2eproto::offsets[] PROTOBUF_SECTI ::_pbi::kInvalidFieldOffsetTag, ::_pbi::kInvalidFieldOffsetTag, ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, PROTOBUF_FIELD_OFFSET(::greptime::v1::Value, _impl_.value_data_), }; static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { @@ -173,7 +174,7 @@ const char descriptor_table_protodef_greptime_2fv1_2frow_2eproto[] PROTOBUF_SECT "\022@\n\022datatype_extension\030\004 \001(\0132$.greptime." "v1.ColumnDataTypeExtension\022+\n\007options\030\005 " "\001(\0132\032.greptime.v1.ColumnOptions\")\n\003Row\022\"" - "\n\006values\030\001 \003(\0132\022.greptime.v1.Value\"\274\006\n\005V" + "\n\006values\030\001 \003(\0132\022.greptime.v1.Value\"\322\006\n\005V" "alue\022\022\n\010i8_value\030\001 \001(\005H\000\022\023\n\ti16_value\030\002 " "\001(\005H\000\022\023\n\ti32_value\030\003 \001(\005H\000\022\023\n\ti64_value\030" "\004 \001(\003H\000\022\022\n\010u8_value\030\005 \001(\rH\000\022\023\n\tu16_value" @@ -194,16 +195,17 @@ const char descriptor_table_protodef_greptime_2fv1_2frow_2eproto[] PROTOBUF_SECT "H\000\022J\n\035interval_month_day_nano_value\030\032 \001(" "\0132!.greptime.v1.IntervalMonthDayNanoH\000\0223" "\n\020decimal128_value\030\037 \001(\0132\027.greptime.v1.D" - "ecimal128H\000B\014\n\nvalue_dataBP\n\016io.greptime" - ".v1B\007RowDataZ5github.com/GreptimeTeam/gr" - "eptime-proto/go/greptime/v1b\006proto3" + "ecimal128H\000\022\024\n\njson_value\030 \001(\014H\000B\014\n\nval" + "ue_dataBP\n\016io.greptime.v1B\007RowDataZ5gith" + "ub.com/GreptimeTeam/greptime-proto/go/gr" + "eptime/v1b\006proto3" ; static const ::_pbi::DescriptorTable* const descriptor_table_greptime_2fv1_2frow_2eproto_deps[1] = { &::descriptor_table_greptime_2fv1_2fcommon_2eproto, }; static ::_pbi::once_flag descriptor_table_greptime_2fv1_2frow_2eproto_once; const ::_pbi::DescriptorTable descriptor_table_greptime_2fv1_2frow_2eproto = { - false, false, 1355, descriptor_table_protodef_greptime_2fv1_2frow_2eproto, + false, false, 1377, descriptor_table_protodef_greptime_2fv1_2frow_2eproto, "greptime/v1/row.proto", &descriptor_table_greptime_2fv1_2frow_2eproto_once, descriptor_table_greptime_2fv1_2frow_2eproto_deps, 1, 4, schemas, file_default_instances, TableStruct_greptime_2fv1_2frow_2eproto::offsets, @@ -1177,6 +1179,10 @@ Value::Value(const Value& from) from._internal_decimal128_value()); break; } + case kJsonValue: { + _this->_internal_set_json_value(from._internal_json_value()); + break; + } case VALUE_DATA_NOT_SET: { break; } @@ -1331,6 +1337,10 @@ void Value::clear_value_data() { } break; } + case kJsonValue: { + _impl_.value_data_.json_value_.Destroy(); + break; + } case VALUE_DATA_NOT_SET: { break; } @@ -1574,6 +1584,15 @@ const char* Value::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { } else goto handle_unusual; continue; + // bytes json_value = 32; + case 32: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 2)) { + auto str = _internal_mutable_json_value(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + } else + goto handle_unusual; + continue; default: goto handle_unusual; } // switch @@ -1771,6 +1790,12 @@ uint8_t* Value::_InternalSerialize( _Internal::decimal128_value(this).GetCachedSize(), target, stream); } + // bytes json_value = 32; + if (_internal_has_json_value()) { + target = stream->WriteBytesMaybeAliased( + 32, this->_internal_json_value(), target); + } + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); @@ -1951,6 +1976,13 @@ size_t Value::ByteSizeLong() const { *_impl_.value_data_.decimal128_value_); break; } + // bytes json_value = 32; + case kJsonValue: { + total_size += 2 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_json_value()); + break; + } case VALUE_DATA_NOT_SET: { break; } @@ -2084,6 +2116,10 @@ void Value::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF from._internal_decimal128_value()); break; } + case kJsonValue: { + _this->_internal_set_json_value(from._internal_json_value()); + break; + } case VALUE_DATA_NOT_SET: { break; } diff --git a/c++/greptime/v1/row.pb.h b/c++/greptime/v1/row.pb.h index 62a9f94f..6db94293 100644 --- a/c++/greptime/v1/row.pb.h +++ b/c++/greptime/v1/row.pb.h @@ -692,6 +692,7 @@ class Value final : kIntervalDayTimeValue = 25, kIntervalMonthDayNanoValue = 26, kDecimal128Value = 31, + kJsonValue = 32, VALUE_DATA_NOT_SET = 0, }; @@ -800,6 +801,7 @@ class Value final : kIntervalDayTimeValueFieldNumber = 25, kIntervalMonthDayNanoValueFieldNumber = 26, kDecimal128ValueFieldNumber = 31, + kJsonValueFieldNumber = 32, }; // int32 i8_value = 1; bool has_i8_value() const; @@ -1172,6 +1174,24 @@ class Value final : ::greptime::v1::Decimal128* decimal128_value); ::greptime::v1::Decimal128* unsafe_arena_release_decimal128_value(); + // bytes json_value = 32; + bool has_json_value() const; + private: + bool _internal_has_json_value() const; + public: + void clear_json_value(); + const std::string& json_value() const; + template + void set_json_value(ArgT0&& arg0, ArgT... args); + std::string* mutable_json_value(); + PROTOBUF_NODISCARD std::string* release_json_value(); + void set_allocated_json_value(std::string* json_value); + private: + const std::string& _internal_json_value() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_json_value(const std::string& value); + std::string* _internal_mutable_json_value(); + public: + void clear_value_data(); ValueDataCase value_data_case() const; // @@protoc_insertion_point(class_scope:greptime.v1.Value) @@ -1204,6 +1224,7 @@ class Value final : void set_has_interval_day_time_value(); void set_has_interval_month_day_nano_value(); void set_has_decimal128_value(); + void set_has_json_value(); inline bool has_value_data() const; inline void clear_has_value_data(); @@ -1242,6 +1263,7 @@ class Value final : int64_t interval_day_time_value_; ::greptime::v1::IntervalMonthDayNano* interval_month_day_nano_value_; ::greptime::v1::Decimal128* decimal128_value_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr json_value_; } value_data_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; uint32_t _oneof_case_[1]; @@ -2813,6 +2835,83 @@ inline ::greptime::v1::Decimal128* Value::mutable_decimal128_value() { return _msg; } +// bytes json_value = 32; +inline bool Value::_internal_has_json_value() const { + return value_data_case() == kJsonValue; +} +inline bool Value::has_json_value() const { + return _internal_has_json_value(); +} +inline void Value::set_has_json_value() { + _impl_._oneof_case_[0] = kJsonValue; +} +inline void Value::clear_json_value() { + if (_internal_has_json_value()) { + _impl_.value_data_.json_value_.Destroy(); + clear_has_value_data(); + } +} +inline const std::string& Value::json_value() const { + // @@protoc_insertion_point(field_get:greptime.v1.Value.json_value) + return _internal_json_value(); +} +template +inline void Value::set_json_value(ArgT0&& arg0, ArgT... args) { + if (!_internal_has_json_value()) { + clear_value_data(); + set_has_json_value(); + _impl_.value_data_.json_value_.InitDefault(); + } + _impl_.value_data_.json_value_.SetBytes( static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:greptime.v1.Value.json_value) +} +inline std::string* Value::mutable_json_value() { + std::string* _s = _internal_mutable_json_value(); + // @@protoc_insertion_point(field_mutable:greptime.v1.Value.json_value) + return _s; +} +inline const std::string& Value::_internal_json_value() const { + if (_internal_has_json_value()) { + return _impl_.value_data_.json_value_.Get(); + } + return ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(); +} +inline void Value::_internal_set_json_value(const std::string& value) { + if (!_internal_has_json_value()) { + clear_value_data(); + set_has_json_value(); + _impl_.value_data_.json_value_.InitDefault(); + } + _impl_.value_data_.json_value_.Set(value, GetArenaForAllocation()); +} +inline std::string* Value::_internal_mutable_json_value() { + if (!_internal_has_json_value()) { + clear_value_data(); + set_has_json_value(); + _impl_.value_data_.json_value_.InitDefault(); + } + return _impl_.value_data_.json_value_.Mutable( GetArenaForAllocation()); +} +inline std::string* Value::release_json_value() { + // @@protoc_insertion_point(field_release:greptime.v1.Value.json_value) + if (_internal_has_json_value()) { + clear_has_value_data(); + return _impl_.value_data_.json_value_.Release(); + } else { + return nullptr; + } +} +inline void Value::set_allocated_json_value(std::string* json_value) { + if (has_value_data()) { + clear_value_data(); + } + if (json_value != nullptr) { + set_has_json_value(); + _impl_.value_data_.json_value_.InitAllocated(json_value, GetArenaForAllocation()); + } + // @@protoc_insertion_point(field_set_allocated:greptime.v1.Value.json_value) +} + inline bool Value::has_value_data() const { return value_data_case() != VALUE_DATA_NOT_SET; } diff --git a/go/greptime/v1/column.pb.go b/go/greptime/v1/column.pb.go index f3e8da07..a614bd6c 100644 --- a/go/greptime/v1/column.pb.go +++ b/go/greptime/v1/column.pb.go @@ -177,6 +177,7 @@ type Column_Values struct { IntervalDayTimeValues []int64 `protobuf:"varint,25,rep,packed,name=interval_day_time_values,json=intervalDayTimeValues,proto3" json:"interval_day_time_values,omitempty"` IntervalMonthDayNanoValues []*IntervalMonthDayNano `protobuf:"bytes,26,rep,name=interval_month_day_nano_values,json=intervalMonthDayNanoValues,proto3" json:"interval_month_day_nano_values,omitempty"` Decimal128Values []*Decimal128 `protobuf:"bytes,31,rep,name=decimal128_values,json=decimal128Values,proto3" json:"decimal128_values,omitempty"` + JsonValues [][]byte `protobuf:"bytes,32,rep,name=json_values,json=jsonValues,proto3" json:"json_values,omitempty"` } func (x *Column_Values) Reset() { @@ -400,6 +401,13 @@ func (x *Column_Values) GetDecimal128Values() []*Decimal128 { return nil } +func (x *Column_Values) GetJsonValues() [][]byte { + if x != nil { + return x.JsonValues + } + return nil +} + var File_greptime_v1_column_proto protoreflect.FileDescriptor var file_greptime_v1_column_proto_rawDesc = []byte{ @@ -407,7 +415,7 @@ var file_greptime_v1_column_proto_rawDesc = []byte{ 0x6c, 0x75, 0x6d, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x18, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x22, 0xe3, 0x0c, 0x0a, 0x06, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, + 0x6f, 0x22, 0x84, 0x0d, 0x0a, 0x06, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x0d, 0x73, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, @@ -431,7 +439,7 @@ var file_greptime_v1_column_proto_rawDesc = []byte{ 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x1a, 0xe2, 0x09, 0x0a, 0x06, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x1b, 0x0a, + 0x6e, 0x73, 0x1a, 0x83, 0x0a, 0x0a, 0x06, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x38, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x52, 0x08, 0x69, 0x38, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x31, 0x36, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 0x52, 0x09, @@ -509,13 +517,15 @@ var file_greptime_v1_column_proto_rawDesc = []byte{ 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x1f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x31, 0x32, 0x38, 0x52, 0x10, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x31, 0x32, - 0x38, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x42, 0x50, 0x0a, 0x0e, 0x69, 0x6f, 0x2e, 0x67, 0x72, - 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x43, 0x6f, 0x6c, 0x75, 0x6d, - 0x6e, 0x73, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x47, - 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, + 0x38, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x20, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0a, 0x6a, 0x73, + 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x42, 0x50, 0x0a, 0x0e, 0x69, 0x6f, 0x2e, 0x67, + 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x43, 0x6f, 0x6c, 0x75, + 0x6d, 0x6e, 0x73, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x47, 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 ( diff --git a/go/greptime/v1/common.pb.go b/go/greptime/v1/common.pb.go index 3dd34491..d9a1d0da 100644 --- a/go/greptime/v1/common.pb.go +++ b/go/greptime/v1/common.pb.go @@ -113,6 +113,7 @@ const ( ColumnDataType_INTERVAL_DAY_TIME ColumnDataType = 24 ColumnDataType_INTERVAL_MONTH_DAY_NANO ColumnDataType = 25 ColumnDataType_DECIMAL128 ColumnDataType = 30 + ColumnDataType_JSON ColumnDataType = 31 ) // Enum value maps for ColumnDataType. @@ -145,6 +146,7 @@ var ( 24: "INTERVAL_DAY_TIME", 25: "INTERVAL_MONTH_DAY_NANO", 30: "DECIMAL128", + 31: "JSON", } ColumnDataType_value = map[string]int32{ "BOOLEAN": 0, @@ -174,6 +176,7 @@ var ( "INTERVAL_DAY_TIME": 24, "INTERVAL_MONTH_DAY_NANO": 25, "DECIMAL128": 30, + "JSON": 31, } ) @@ -1353,7 +1356,7 @@ var file_greptime_v1_common_proto_rawDesc = []byte{ 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x2a, 0x31, 0x0a, 0x0c, 0x53, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x54, 0x79, 0x70, 0x65, 0x12, 0x07, 0x0a, 0x03, 0x54, 0x41, 0x47, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x49, - 0x4d, 0x45, 0x53, 0x54, 0x41, 0x4d, 0x50, 0x10, 0x02, 0x2a, 0xd6, 0x03, 0x0a, 0x0e, 0x43, 0x6f, + 0x4d, 0x45, 0x53, 0x54, 0x41, 0x4d, 0x50, 0x10, 0x02, 0x2a, 0xe0, 0x03, 0x0a, 0x0e, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x42, 0x4f, 0x4f, 0x4c, 0x45, 0x41, 0x4e, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x4e, 0x54, 0x38, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x49, 0x4e, 0x54, 0x31, 0x36, 0x10, 0x02, 0x12, 0x09, @@ -1383,12 +1386,13 @@ var file_greptime_v1_common_proto_rawDesc = []byte{ 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, 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, - 0x65, 0x2e, 0x76, 0x31, 0x42, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5a, 0x35, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x47, 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, + 0x10, 0x1e, 0x12, 0x08, 0x0a, 0x04, 0x4a, 0x53, 0x4f, 0x4e, 0x10, 0x1f, 0x42, 0x4f, 0x0a, 0x0e, + 0x69, 0x6f, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x06, + 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x47, 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 ( diff --git a/go/greptime/v1/row.pb.go b/go/greptime/v1/row.pb.go index 4180be94..bd70e125 100644 --- a/go/greptime/v1/row.pb.go +++ b/go/greptime/v1/row.pb.go @@ -251,6 +251,7 @@ type Value struct { // *Value_IntervalDayTimeValue // *Value_IntervalMonthDayNanoValue // *Value_Decimal128Value + // *Value_JsonValue ValueData isValue_ValueData `protobuf_oneof:"value_data"` } @@ -482,6 +483,13 @@ func (x *Value) GetDecimal128Value() *Decimal128 { return nil } +func (x *Value) GetJsonValue() []byte { + if x, ok := x.GetValueData().(*Value_JsonValue); ok { + return x.JsonValue + } + return nil +} + type isValue_ValueData interface { isValue_ValueData() } @@ -594,6 +602,10 @@ type Value_Decimal128Value struct { Decimal128Value *Decimal128 `protobuf:"bytes,31,opt,name=decimal128_value,json=decimal128Value,proto3,oneof"` } +type Value_JsonValue struct { + JsonValue []byte `protobuf:"bytes,32,opt,name=json_value,json=jsonValue,proto3,oneof"` +} + func (*Value_I8Value) isValue_ValueData() {} func (*Value_I16Value) isValue_ValueData() {} @@ -648,6 +660,8 @@ func (*Value_IntervalMonthDayNanoValue) isValue_ValueData() {} func (*Value_Decimal128Value) isValue_ValueData() {} +func (*Value_JsonValue) isValue_ValueData() {} + var File_greptime_v1_row_proto protoreflect.FileDescriptor var file_greptime_v1_row_proto_rawDesc = []byte{ @@ -683,7 +697,7 @@ var file_greptime_v1_row_proto_rawDesc = []byte{ 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x31, 0x0a, 0x03, 0x52, 0x6f, 0x77, 0x12, 0x2a, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0xef, 0x09, 0x0a, 0x05, 0x56, 0x61, 0x6c, + 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0x90, 0x0a, 0x0a, 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1b, 0x0a, 0x08, 0x69, 0x38, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x48, 0x00, 0x52, 0x07, 0x69, 0x38, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1d, 0x0a, 0x09, 0x69, 0x31, 0x36, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, @@ -761,14 +775,16 @@ var file_greptime_v1_row_proto_rawDesc = []byte{ 0x6c, 0x31, 0x32, 0x38, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x31, 0x32, 0x38, 0x48, 0x00, 0x52, 0x0f, 0x64, 0x65, 0x63, - 0x69, 0x6d, 0x61, 0x6c, 0x31, 0x32, 0x38, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x0c, 0x0a, 0x0a, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x42, 0x50, 0x0a, 0x0e, 0x69, 0x6f, - 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x52, 0x6f, - 0x77, 0x44, 0x61, 0x74, 0x61, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x47, 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, + 0x69, 0x6d, 0x61, 0x6c, 0x31, 0x32, 0x38, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1f, 0x0a, 0x0a, + 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x20, 0x20, 0x01, 0x28, 0x0c, + 0x48, 0x00, 0x52, 0x09, 0x6a, 0x73, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x0c, 0x0a, + 0x0a, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x42, 0x50, 0x0a, 0x0e, 0x69, + 0x6f, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x52, + 0x6f, 0x77, 0x44, 0x61, 0x74, 0x61, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x47, 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 ( @@ -897,6 +913,7 @@ func file_greptime_v1_row_proto_init() { (*Value_IntervalDayTimeValue)(nil), (*Value_IntervalMonthDayNanoValue)(nil), (*Value_Decimal128Value)(nil), + (*Value_JsonValue)(nil), } type x struct{} out := protoimpl.TypeBuilder{ diff --git a/java/src/main/java/io/greptime/v1/Columns.java b/java/src/main/java/io/greptime/v1/Columns.java index ef49f9dd..d6f8fb33 100644 --- a/java/src/main/java/io/greptime/v1/Columns.java +++ b/java/src/main/java/io/greptime/v1/Columns.java @@ -803,6 +803,23 @@ io.greptime.v1.Common.IntervalMonthDayNanoOrBuilder getIntervalMonthDayNanoValue */ io.greptime.v1.Common.Decimal128OrBuilder getDecimal128ValuesOrBuilder( int index); + + /** + * repeated bytes json_values = 32; + * @return A list containing the jsonValues. + */ + java.util.List getJsonValuesList(); + /** + * repeated bytes json_values = 32; + * @return The count of jsonValues. + */ + int getJsonValuesCount(); + /** + * repeated bytes json_values = 32; + * @param index The index of the element to return. + * @return The jsonValues at the given index. + */ + com.google.protobuf.ByteString getJsonValues(int index); } /** * Protobuf type {@code greptime.v1.Column.Values} @@ -844,6 +861,7 @@ private Values() { intervalDayTimeValues_ = emptyLongList(); intervalMonthDayNanoValues_ = java.util.Collections.emptyList(); decimal128Values_ = java.util.Collections.emptyList(); + jsonValues_ = java.util.Collections.emptyList(); } @java.lang.Override @@ -1395,6 +1413,14 @@ private Values( input.readMessage(io.greptime.v1.Common.Decimal128.parser(), extensionRegistry)); break; } + case 258: { + if (!((mutable_bitField0_ & 0x08000000) != 0)) { + jsonValues_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x08000000; + } + jsonValues_.add(input.readBytes()); + break; + } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { @@ -1493,6 +1519,9 @@ private Values( if (((mutable_bitField0_ & 0x04000000) != 0)) { decimal128Values_ = java.util.Collections.unmodifiableList(decimal128Values_); } + if (((mutable_bitField0_ & 0x08000000) != 0)) { + jsonValues_ = java.util.Collections.unmodifiableList(jsonValues_); // C + } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } @@ -2296,6 +2325,33 @@ public io.greptime.v1.Common.Decimal128OrBuilder getDecimal128ValuesOrBuilder( return decimal128Values_.get(index); } + public static final int JSON_VALUES_FIELD_NUMBER = 32; + private java.util.List jsonValues_; + /** + * repeated bytes json_values = 32; + * @return A list containing the jsonValues. + */ + @java.lang.Override + public java.util.List + getJsonValuesList() { + return jsonValues_; + } + /** + * repeated bytes json_values = 32; + * @return The count of jsonValues. + */ + public int getJsonValuesCount() { + return jsonValues_.size(); + } + /** + * repeated bytes json_values = 32; + * @param index The index of the element to return. + * @return The jsonValues at the given index. + */ + public com.google.protobuf.ByteString getJsonValues(int index) { + return jsonValues_.get(index); + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -2484,6 +2540,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) for (int i = 0; i < decimal128Values_.size(); i++) { output.writeMessage(31, decimal128Values_.get(i)); } + for (int i = 0; i < jsonValues_.size(); i++) { + output.writeBytes(32, jsonValues_.get(i)); + } unknownFields.writeTo(output); } @@ -2831,6 +2890,15 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeMessageSize(31, decimal128Values_.get(i)); } + { + int dataSize = 0; + for (int i = 0; i < jsonValues_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeBytesSizeNoTag(jsonValues_.get(i)); + } + size += dataSize; + size += 2 * getJsonValuesList().size(); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -2900,6 +2968,8 @@ public boolean equals(final java.lang.Object obj) { .equals(other.getIntervalMonthDayNanoValuesList())) return false; if (!getDecimal128ValuesList() .equals(other.getDecimal128ValuesList())) return false; + if (!getJsonValuesList() + .equals(other.getJsonValuesList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -3019,6 +3089,10 @@ public int hashCode() { hash = (37 * hash) + DECIMAL128_VALUES_FIELD_NUMBER; hash = (53 * hash) + getDecimal128ValuesList().hashCode(); } + if (getJsonValuesCount() > 0) { + hash = (37 * hash) + JSON_VALUES_FIELD_NUMBER; + hash = (53 * hash) + getJsonValuesList().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -3216,6 +3290,8 @@ public Builder clear() { } else { decimal128ValuesBuilder_.clear(); } + jsonValues_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x08000000); return this; } @@ -3386,6 +3462,11 @@ public io.greptime.v1.Columns.Column.Values buildPartial() { } else { result.decimal128Values_ = decimal128ValuesBuilder_.build(); } + if (((bitField0_ & 0x08000000) != 0)) { + jsonValues_ = java.util.Collections.unmodifiableList(jsonValues_); + bitField0_ = (bitField0_ & ~0x08000000); + } + result.jsonValues_ = jsonValues_; onBuilt(); return result; } @@ -3736,6 +3817,16 @@ public Builder mergeFrom(io.greptime.v1.Columns.Column.Values other) { } } } + if (!other.jsonValues_.isEmpty()) { + if (jsonValues_.isEmpty()) { + jsonValues_ = other.jsonValues_; + bitField0_ = (bitField0_ & ~0x08000000); + } else { + ensureJsonValuesIsMutable(); + jsonValues_.addAll(other.jsonValues_); + } + onChanged(); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -6257,6 +6348,91 @@ public io.greptime.v1.Common.Decimal128.Builder addDecimal128ValuesBuilder( } return decimal128ValuesBuilder_; } + + private java.util.List jsonValues_ = java.util.Collections.emptyList(); + private void ensureJsonValuesIsMutable() { + if (!((bitField0_ & 0x08000000) != 0)) { + jsonValues_ = new java.util.ArrayList(jsonValues_); + bitField0_ |= 0x08000000; + } + } + /** + * repeated bytes json_values = 32; + * @return A list containing the jsonValues. + */ + public java.util.List + getJsonValuesList() { + return ((bitField0_ & 0x08000000) != 0) ? + java.util.Collections.unmodifiableList(jsonValues_) : jsonValues_; + } + /** + * repeated bytes json_values = 32; + * @return The count of jsonValues. + */ + public int getJsonValuesCount() { + return jsonValues_.size(); + } + /** + * repeated bytes json_values = 32; + * @param index The index of the element to return. + * @return The jsonValues at the given index. + */ + public com.google.protobuf.ByteString getJsonValues(int index) { + return jsonValues_.get(index); + } + /** + * repeated bytes json_values = 32; + * @param index The index to set the value at. + * @param value The jsonValues to set. + * @return This builder for chaining. + */ + public Builder setJsonValues( + int index, com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureJsonValuesIsMutable(); + jsonValues_.set(index, value); + onChanged(); + return this; + } + /** + * repeated bytes json_values = 32; + * @param value The jsonValues to add. + * @return This builder for chaining. + */ + public Builder addJsonValues(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureJsonValuesIsMutable(); + jsonValues_.add(value); + onChanged(); + return this; + } + /** + * repeated bytes json_values = 32; + * @param values The jsonValues to add. + * @return This builder for chaining. + */ + public Builder addAllJsonValues( + java.lang.Iterable values) { + ensureJsonValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, jsonValues_); + onChanged(); + return this; + } + /** + * repeated bytes json_values = 32; + * @return This builder for chaining. + */ + public Builder clearJsonValues() { + jsonValues_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x08000000); + onChanged(); + return this; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -7843,7 +8019,7 @@ public io.greptime.v1.Columns.Column getDefaultInstanceForType() { static { java.lang.String[] descriptorData = { "\n\030greptime/v1/column.proto\022\013greptime.v1\032" + - "\030greptime/v1/common.proto\"\303\010\n\006Column\022\023\n\013" + + "\030greptime/v1/common.proto\"\330\010\n\006Column\022\023\n\013" + "column_name\030\001 \001(\t\0220\n\rsemantic_type\030\002 \001(\016" + "2\031.greptime.v1.SemanticType\022*\n\006values\030\003 " + "\001(\0132\032.greptime.v1.Column.Values\022\021\n\tnull_" + @@ -7851,7 +8027,7 @@ public io.greptime.v1.Columns.Column getDefaultInstanceForType() { "v1.ColumnDataType\022@\n\022datatype_extension\030" + "\006 \001(\0132$.greptime.v1.ColumnDataTypeExtens" + "ion\022+\n\007options\030\007 \001(\0132\032.greptime.v1.Colum" + - "nOptions\032\224\006\n\006Values\022\021\n\ti8_values\030\001 \003(\005\022\022" + + "nOptions\032\251\006\n\006Values\022\021\n\ti8_values\030\001 \003(\005\022\022" + "\n\ni16_values\030\002 \003(\005\022\022\n\ni32_values\030\003 \003(\005\022\022" + "\n\ni64_values\030\004 \003(\003\022\021\n\tu8_values\030\005 \003(\r\022\022\n" + "\nu16_values\030\006 \003(\r\022\022\n\nu32_values\030\007 \003(\r\022\022\n" + @@ -7870,10 +8046,10 @@ public io.greptime.v1.Columns.Column getDefaultInstanceForType() { "\n\030interval_day_time_values\030\031 \003(\003\022I\n\036inte" + "rval_month_day_nano_values\030\032 \003(\0132!.grept" + "ime.v1.IntervalMonthDayNano\0222\n\021decimal12" + - "8_values\030\037 \003(\0132\027.greptime.v1.Decimal128B" + - "P\n\016io.greptime.v1B\007ColumnsZ5github.com/G" + - "reptimeTeam/greptime-proto/go/greptime/v" + - "1b\006proto3" + "8_values\030\037 \003(\0132\027.greptime.v1.Decimal128\022" + + "\023\n\013json_values\030 \003(\014BP\n\016io.greptime.v1B\007" + + "ColumnsZ5github.com/GreptimeTeam/greptim" + + "e-proto/go/greptime/v1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -7891,7 +8067,7 @@ public io.greptime.v1.Columns.Column getDefaultInstanceForType() { internal_static_greptime_v1_Column_Values_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_greptime_v1_Column_Values_descriptor, - new java.lang.String[] { "I8Values", "I16Values", "I32Values", "I64Values", "U8Values", "U16Values", "U32Values", "U64Values", "F32Values", "F64Values", "BoolValues", "BinaryValues", "StringValues", "DateValues", "DatetimeValues", "TimestampSecondValues", "TimestampMillisecondValues", "TimestampMicrosecondValues", "TimestampNanosecondValues", "TimeSecondValues", "TimeMillisecondValues", "TimeMicrosecondValues", "TimeNanosecondValues", "IntervalYearMonthValues", "IntervalDayTimeValues", "IntervalMonthDayNanoValues", "Decimal128Values", }); + new java.lang.String[] { "I8Values", "I16Values", "I32Values", "I64Values", "U8Values", "U16Values", "U32Values", "U64Values", "F32Values", "F64Values", "BoolValues", "BinaryValues", "StringValues", "DateValues", "DatetimeValues", "TimestampSecondValues", "TimestampMillisecondValues", "TimestampMicrosecondValues", "TimestampNanosecondValues", "TimeSecondValues", "TimeMillisecondValues", "TimeMicrosecondValues", "TimeNanosecondValues", "IntervalYearMonthValues", "IntervalDayTimeValues", "IntervalMonthDayNanoValues", "Decimal128Values", "JsonValues", }); io.greptime.v1.Common.getDescriptor(); } diff --git a/java/src/main/java/io/greptime/v1/Common.java b/java/src/main/java/io/greptime/v1/Common.java index c45dee34..578919b9 100644 --- a/java/src/main/java/io/greptime/v1/Common.java +++ b/java/src/main/java/io/greptime/v1/Common.java @@ -244,6 +244,10 @@ public enum ColumnDataType * DECIMAL128 = 30; */ DECIMAL128(30), + /** + * JSON = 31; + */ + JSON(31), UNRECOGNIZED(-1), ; @@ -355,6 +359,10 @@ public enum ColumnDataType * DECIMAL128 = 30; */ public static final int DECIMAL128_VALUE = 30; + /** + * JSON = 31; + */ + public static final int JSON_VALUE = 31; public final int getNumber() { @@ -408,6 +416,7 @@ public static ColumnDataType forNumber(int value) { case 24: return INTERVAL_DAY_TIME; case 25: return INTERVAL_MONTH_DAY_NANO; case 30: return DECIMAL128; + case 31: return JSON; default: return null; } } @@ -13933,7 +13942,7 @@ public io.greptime.v1.Common.ColumnOptions getDefaultInstanceForType() { "\001 \003(\0132\'.greptime.v1.ColumnOptions.Option" + "sEntry\032.\n\014OptionsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005v" + "alue\030\002 \001(\t:\0028\001*1\n\014SemanticType\022\007\n\003TAG\020\000\022" + - "\t\n\005FIELD\020\001\022\r\n\tTIMESTAMP\020\002*\326\003\n\016ColumnData" + + "\t\n\005FIELD\020\001\022\r\n\tTIMESTAMP\020\002*\340\003\n\016ColumnData" + "Type\022\013\n\007BOOLEAN\020\000\022\010\n\004INT8\020\001\022\t\n\005INT16\020\002\022\t" + "\n\005INT32\020\003\022\t\n\005INT64\020\004\022\t\n\005UINT8\020\005\022\n\n\006UINT1" + "6\020\006\022\n\n\006UINT32\020\007\022\n\n\006UINT64\020\010\022\013\n\007FLOAT32\020\t" + @@ -13945,9 +13954,9 @@ public io.greptime.v1.Common.ColumnOptions getDefaultInstanceForType() { "\020\024\022\024\n\020TIME_MICROSECOND\020\025\022\023\n\017TIME_NANOSEC" + "OND\020\026\022\027\n\023INTERVAL_YEAR_MONTH\020\027\022\025\n\021INTERV" + "AL_DAY_TIME\020\030\022\033\n\027INTERVAL_MONTH_DAY_NANO" + - "\020\031\022\016\n\nDECIMAL128\020\036BO\n\016io.greptime.v1B\006Co" + - "mmonZ5github.com/GreptimeTeam/greptime-p" + - "roto/go/greptime/v1b\006proto3" + "\020\031\022\016\n\nDECIMAL128\020\036\022\010\n\004JSON\020\037BO\n\016io.grept" + + "ime.v1B\006CommonZ5github.com/GreptimeTeam/" + + "greptime-proto/go/greptime/v1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, diff --git a/java/src/main/java/io/greptime/v1/RowData.java b/java/src/main/java/io/greptime/v1/RowData.java index 00307cf2..0f9ef8f2 100644 --- a/java/src/main/java/io/greptime/v1/RowData.java +++ b/java/src/main/java/io/greptime/v1/RowData.java @@ -3601,6 +3601,17 @@ public interface ValueOrBuilder extends */ io.greptime.v1.Common.Decimal128OrBuilder getDecimal128ValueOrBuilder(); + /** + * bytes json_value = 32; + * @return Whether the jsonValue field is set. + */ + boolean hasJsonValue(); + /** + * bytes json_value = 32; + * @return The jsonValue. + */ + com.google.protobuf.ByteString getJsonValue(); + public io.greptime.v1.RowData.Value.ValueDataCase getValueDataCase(); } /** @@ -3802,6 +3813,11 @@ private Value( valueDataCase_ = 31; break; } + case 258: { + valueData_ = input.readBytes(); + valueDataCase_ = 32; + break; + } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { @@ -3868,6 +3884,7 @@ public enum ValueDataCase INTERVAL_DAY_TIME_VALUE(25), INTERVAL_MONTH_DAY_NANO_VALUE(26), DECIMAL128_VALUE(31), + JSON_VALUE(32), VALUEDATA_NOT_SET(0); private final int value; private ValueDataCase(int value) { @@ -3912,6 +3929,7 @@ public static ValueDataCase forNumber(int value) { case 25: return INTERVAL_DAY_TIME_VALUE; case 26: return INTERVAL_MONTH_DAY_NANO_VALUE; case 31: return DECIMAL128_VALUE; + case 32: return JSON_VALUE; case 0: return VALUEDATA_NOT_SET; default: return null; } @@ -4545,6 +4563,27 @@ public io.greptime.v1.Common.Decimal128OrBuilder getDecimal128ValueOrBuilder() { return io.greptime.v1.Common.Decimal128.getDefaultInstance(); } + public static final int JSON_VALUE_FIELD_NUMBER = 32; + /** + * bytes json_value = 32; + * @return Whether the jsonValue field is set. + */ + @java.lang.Override + public boolean hasJsonValue() { + return valueDataCase_ == 32; + } + /** + * bytes json_value = 32; + * @return The jsonValue. + */ + @java.lang.Override + public com.google.protobuf.ByteString getJsonValue() { + if (valueDataCase_ == 32) { + return (com.google.protobuf.ByteString) valueData_; + } + return com.google.protobuf.ByteString.EMPTY; + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -4664,6 +4703,10 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (valueDataCase_ == 31) { output.writeMessage(31, (io.greptime.v1.Common.Decimal128) valueData_); } + if (valueDataCase_ == 32) { + output.writeBytes( + 32, (com.google.protobuf.ByteString) valueData_); + } unknownFields.writeTo(output); } @@ -4804,6 +4847,11 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeMessageSize(31, (io.greptime.v1.Common.Decimal128) valueData_); } + if (valueDataCase_ == 32) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize( + 32, (com.google.protobuf.ByteString) valueData_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -4931,6 +4979,10 @@ public boolean equals(final java.lang.Object obj) { if (!getDecimal128Value() .equals(other.getDecimal128Value())) return false; break; + case 32: + if (!getJsonValue() + .equals(other.getJsonValue())) return false; + break; case 0: default: } @@ -5069,6 +5121,10 @@ public int hashCode() { hash = (37 * hash) + DECIMAL128_VALUE_FIELD_NUMBER; hash = (53 * hash) + getDecimal128Value().hashCode(); break; + case 32: + hash = (37 * hash) + JSON_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getJsonValue().hashCode(); + break; case 0: default: } @@ -5322,6 +5378,9 @@ public io.greptime.v1.RowData.Value buildPartial() { result.valueData_ = decimal128ValueBuilder_.build(); } } + if (valueDataCase_ == 32) { + result.valueData_ = valueData_; + } result.valueDataCase_ = valueDataCase_; onBuilt(); return result; @@ -5482,6 +5541,10 @@ public Builder mergeFrom(io.greptime.v1.RowData.Value other) { mergeDecimal128Value(other.getDecimal128Value()); break; } + case JSON_VALUE: { + setJsonValue(other.getJsonValue()); + break; + } case VALUEDATA_NOT_SET: { break; } @@ -6897,6 +6960,50 @@ public io.greptime.v1.Common.Decimal128OrBuilder getDecimal128ValueOrBuilder() { onChanged();; return decimal128ValueBuilder_; } + + /** + * bytes json_value = 32; + * @return Whether the jsonValue field is set. + */ + public boolean hasJsonValue() { + return valueDataCase_ == 32; + } + /** + * bytes json_value = 32; + * @return The jsonValue. + */ + public com.google.protobuf.ByteString getJsonValue() { + if (valueDataCase_ == 32) { + return (com.google.protobuf.ByteString) valueData_; + } + return com.google.protobuf.ByteString.EMPTY; + } + /** + * bytes json_value = 32; + * @param value The jsonValue to set. + * @return This builder for chaining. + */ + public Builder setJsonValue(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + valueDataCase_ = 32; + valueData_ = value; + onChanged(); + return this; + } + /** + * bytes json_value = 32; + * @return This builder for chaining. + */ + public Builder clearJsonValue() { + if (valueDataCase_ == 32) { + valueDataCase_ = 0; + valueData_ = null; + onChanged(); + } + return this; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -6989,7 +7096,7 @@ public io.greptime.v1.RowData.Value getDefaultInstanceForType() { "\022@\n\022datatype_extension\030\004 \001(\0132$.greptime." + "v1.ColumnDataTypeExtension\022+\n\007options\030\005 " + "\001(\0132\032.greptime.v1.ColumnOptions\")\n\003Row\022\"" + - "\n\006values\030\001 \003(\0132\022.greptime.v1.Value\"\274\006\n\005V" + + "\n\006values\030\001 \003(\0132\022.greptime.v1.Value\"\322\006\n\005V" + "alue\022\022\n\010i8_value\030\001 \001(\005H\000\022\023\n\ti16_value\030\002 " + "\001(\005H\000\022\023\n\ti32_value\030\003 \001(\005H\000\022\023\n\ti64_value\030" + "\004 \001(\003H\000\022\022\n\010u8_value\030\005 \001(\rH\000\022\023\n\tu16_value" + @@ -7010,9 +7117,10 @@ public io.greptime.v1.RowData.Value getDefaultInstanceForType() { "H\000\022J\n\035interval_month_day_nano_value\030\032 \001(" + "\0132!.greptime.v1.IntervalMonthDayNanoH\000\0223" + "\n\020decimal128_value\030\037 \001(\0132\027.greptime.v1.D" + - "ecimal128H\000B\014\n\nvalue_dataBP\n\016io.greptime" + - ".v1B\007RowDataZ5github.com/GreptimeTeam/gr" + - "eptime-proto/go/greptime/v1b\006proto3" + "ecimal128H\000\022\024\n\njson_value\030 \001(\014H\000B\014\n\nval" + + "ue_dataBP\n\016io.greptime.v1B\007RowDataZ5gith" + + "ub.com/GreptimeTeam/greptime-proto/go/gr" + + "eptime/v1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -7042,7 +7150,7 @@ public io.greptime.v1.RowData.Value getDefaultInstanceForType() { internal_static_greptime_v1_Value_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_greptime_v1_Value_descriptor, - new java.lang.String[] { "I8Value", "I16Value", "I32Value", "I64Value", "U8Value", "U16Value", "U32Value", "U64Value", "F32Value", "F64Value", "BoolValue", "BinaryValue", "StringValue", "DateValue", "DatetimeValue", "TimestampSecondValue", "TimestampMillisecondValue", "TimestampMicrosecondValue", "TimestampNanosecondValue", "TimeSecondValue", "TimeMillisecondValue", "TimeMicrosecondValue", "TimeNanosecondValue", "IntervalYearMonthValue", "IntervalDayTimeValue", "IntervalMonthDayNanoValue", "Decimal128Value", "ValueData", }); + new java.lang.String[] { "I8Value", "I16Value", "I32Value", "I64Value", "U8Value", "U16Value", "U32Value", "U64Value", "F32Value", "F64Value", "BoolValue", "BinaryValue", "StringValue", "DateValue", "DatetimeValue", "TimestampSecondValue", "TimestampMillisecondValue", "TimestampMicrosecondValue", "TimestampNanosecondValue", "TimeSecondValue", "TimeMillisecondValue", "TimeMicrosecondValue", "TimeNanosecondValue", "IntervalYearMonthValue", "IntervalDayTimeValue", "IntervalMonthDayNanoValue", "Decimal128Value", "JsonValue", "ValueData", }); io.greptime.v1.Common.getDescriptor(); } diff --git a/proto/greptime/v1/column.proto b/proto/greptime/v1/column.proto index 6b754ae9..53c7361d 100644 --- a/proto/greptime/v1/column.proto +++ b/proto/greptime/v1/column.proto @@ -58,6 +58,7 @@ message Column { repeated int64 interval_day_time_values = 25; repeated IntervalMonthDayNano interval_month_day_nano_values = 26; repeated Decimal128 decimal128_values = 31; + repeated bytes json_values = 32; } // The array of non-null values in this column. // diff --git a/proto/greptime/v1/common.proto b/proto/greptime/v1/common.proto index d56aa925..037060a4 100644 --- a/proto/greptime/v1/common.proto +++ b/proto/greptime/v1/common.proto @@ -117,6 +117,7 @@ enum ColumnDataType { INTERVAL_DAY_TIME = 24; INTERVAL_MONTH_DAY_NANO = 25; DECIMAL128 = 30; + JSON = 31; } message IntervalMonthDayNano { diff --git a/proto/greptime/v1/row.proto b/proto/greptime/v1/row.proto index d9f9b1d7..63e9294a 100644 --- a/proto/greptime/v1/row.proto +++ b/proto/greptime/v1/row.proto @@ -74,5 +74,6 @@ message Value { int64 interval_day_time_value = 25; IntervalMonthDayNano interval_month_day_nano_value = 26; Decimal128 decimal128_value = 31; + bytes json_value = 32; } }