feat: introduce partition_rule_version (#306)

* feat: introduce `partition_rule_version`

Signed-off-by: WenyXu <wenymedia@gmail.com>

* feat: introduce `partition_rule_version`

Signed-off-by: WenyXu <wenymedia@gmail.com>

* feat: introduce PartitionRuleVersion

Signed-off-by: WenyXu <wenymedia@gmail.com>

* chore: apply suggestions

Signed-off-by: WenyXu <wenymedia@gmail.com>

---------

Signed-off-by: WenyXu <wenymedia@gmail.com>
This commit is contained in:
Weny Xu
2026-02-06 19:34:18 +08:00
committed by GitHub
parent f1e0ea3a71
commit b9452e3411
15 changed files with 3348 additions and 884 deletions
+229 -24
View File
@@ -488,9 +488,22 @@ struct ArrowIpcDefaultTypeInternal {
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ArrowIpcDefaultTypeInternal _ArrowIpc_default_instance_;
PROTOBUF_CONSTEXPR PartitionRuleVersion::PartitionRuleVersion(
::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_.value_)*/uint64_t{0u}
, /*decltype(_impl_._cached_size_)*/{}} {}
struct PartitionRuleVersionDefaultTypeInternal {
PROTOBUF_CONSTEXPR PartitionRuleVersionDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
~PartitionRuleVersionDefaultTypeInternal() {}
union {
PartitionRuleVersion _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PartitionRuleVersionDefaultTypeInternal _PartitionRuleVersion_default_instance_;
} // namespace v1
} // namespace greptime
static ::_pb::Metadata file_level_metadata_greptime_2fv1_2fcommon_2eproto[34];
static ::_pb::Metadata file_level_metadata_greptime_2fv1_2fcommon_2eproto[35];
static const ::_pb::EnumDescriptor* file_level_enum_descriptors_greptime_2fv1_2fcommon_2eproto[4];
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_greptime_2fv1_2fcommon_2eproto = nullptr;
@@ -789,6 +802,13 @@ const uint32_t TableStruct_greptime_2fv1_2fcommon_2eproto::offsets[] PROTOBUF_SE
PROTOBUF_FIELD_OFFSET(::greptime::v1::ArrowIpc, _impl_.schema_),
PROTOBUF_FIELD_OFFSET(::greptime::v1::ArrowIpc, _impl_.data_header_),
PROTOBUF_FIELD_OFFSET(::greptime::v1::ArrowIpc, _impl_.payload_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::greptime::v1::PartitionRuleVersion, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
PROTOBUF_FIELD_OFFSET(::greptime::v1::PartitionRuleVersion, _impl_.value_),
};
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{ 0, 8, -1, sizeof(::greptime::v1::QueryContext_ExtensionsEntry_DoNotUse)},
@@ -825,6 +845,7 @@ static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protode
{ 268, 276, -1, sizeof(::greptime::v1::ColumnOptions_OptionsEntry_DoNotUse)},
{ 278, -1, -1, sizeof(::greptime::v1::ColumnOptions)},
{ 285, -1, -1, sizeof(::greptime::v1::ArrowIpc)},
{ 294, -1, -1, sizeof(::greptime::v1::PartitionRuleVersion)},
};
static const ::_pb::Message* const file_default_instances[] = {
@@ -862,6 +883,7 @@ static const ::_pb::Message* const file_default_instances[] = {
&::greptime::v1::_ColumnOptions_OptionsEntry_DoNotUse_default_instance_._instance,
&::greptime::v1::_ColumnOptions_default_instance_._instance,
&::greptime::v1::_ArrowIpc_default_instance_._instance,
&::greptime::v1::_PartitionRuleVersion_default_instance_._instance,
};
const char descriptor_table_protodef_greptime_2fv1_2fcommon_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
@@ -946,33 +968,34 @@ const char descriptor_table_protodef_greptime_2fv1_2fcommon_2eproto[] PROTOBUF_S
".ColumnOptions.OptionsEntry\032.\n\014OptionsEn"
"try\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"@\n\010A"
"rrowIpc\022\016\n\006schema\030\001 \001(\014\022\023\n\013data_header\030\002"
" \001(\014\022\017\n\007payload\030\003 \001(\014*1\n\014SemanticType\022\007\n"
"\003TAG\020\000\022\t\n\005FIELD\020\001\022\r\n\tTIMESTAMP\020\002*\222\004\n\016Col"
"umnDataType\022\013\n\007BOOLEAN\020\000\022\010\n\004INT8\020\001\022\t\n\005IN"
"T16\020\002\022\t\n\005INT32\020\003\022\t\n\005INT64\020\004\022\t\n\005UINT8\020\005\022\n"
"\n\006UINT16\020\006\022\n\n\006UINT32\020\007\022\n\n\006UINT64\020\010\022\013\n\007FL"
"OAT32\020\t\022\013\n\007FLOAT64\020\n\022\n\n\006BINARY\020\013\022\n\n\006STRI"
"NG\020\014\022\010\n\004DATE\020\r\022\014\n\010DATETIME\020\016\022\024\n\020TIMESTAM"
"P_SECOND\020\017\022\031\n\025TIMESTAMP_MILLISECOND\020\020\022\031\n"
"\025TIMESTAMP_MICROSECOND\020\021\022\030\n\024TIMESTAMP_NA"
"NOSECOND\020\022\022\017\n\013TIME_SECOND\020\023\022\024\n\020TIME_MILL"
"ISECOND\020\024\022\024\n\020TIME_MICROSECOND\020\025\022\023\n\017TIME_"
"NANOSECOND\020\026\022\027\n\023INTERVAL_YEAR_MONTH\020\027\022\025\n"
"\021INTERVAL_DAY_TIME\020\030\022\033\n\027INTERVAL_MONTH_D"
"AY_NANO\020\031\022\016\n\nDECIMAL128\020\036\022\010\n\004JSON\020\037\022\n\n\006V"
"ECTOR\020 \022\010\n\004LIST\020(\022\n\n\006STRUCT\020)\022\016\n\nDICTION"
"ARY\020**H\n\010TimeUnit\022\017\n\013MILLISECOND\020\000\022\n\n\006SE"
"COND\020\001\022\017\n\013MICROSECOND\020\002\022\016\n\nNANOSECOND\020\003*"
"$\n\021JsonTypeExtension\022\017\n\013JSON_BINARY\020\000BO\n"
"\016io.greptime.v1B\006CommonZ5github.com/Grep"
"timeTeam/greptime-proto/go/greptime/v1b\006"
"proto3"
" \001(\014\022\017\n\007payload\030\003 \001(\014\"%\n\024PartitionRuleVe"
"rsion\022\r\n\005value\030\001 \001(\004*1\n\014SemanticType\022\007\n\003"
"TAG\020\000\022\t\n\005FIELD\020\001\022\r\n\tTIMESTAMP\020\002*\222\004\n\016Colu"
"mnDataType\022\013\n\007BOOLEAN\020\000\022\010\n\004INT8\020\001\022\t\n\005INT"
"16\020\002\022\t\n\005INT32\020\003\022\t\n\005INT64\020\004\022\t\n\005UINT8\020\005\022\n\n"
"\006UINT16\020\006\022\n\n\006UINT32\020\007\022\n\n\006UINT64\020\010\022\013\n\007FLO"
"AT32\020\t\022\013\n\007FLOAT64\020\n\022\n\n\006BINARY\020\013\022\n\n\006STRIN"
"G\020\014\022\010\n\004DATE\020\r\022\014\n\010DATETIME\020\016\022\024\n\020TIMESTAMP"
"_SECOND\020\017\022\031\n\025TIMESTAMP_MILLISECOND\020\020\022\031\n\025"
"TIMESTAMP_MICROSECOND\020\021\022\030\n\024TIMESTAMP_NAN"
"OSECOND\020\022\022\017\n\013TIME_SECOND\020\023\022\024\n\020TIME_MILLI"
"SECOND\020\024\022\024\n\020TIME_MICROSECOND\020\025\022\023\n\017TIME_N"
"ANOSECOND\020\026\022\027\n\023INTERVAL_YEAR_MONTH\020\027\022\025\n\021"
"INTERVAL_DAY_TIME\020\030\022\033\n\027INTERVAL_MONTH_DA"
"Y_NANO\020\031\022\016\n\nDECIMAL128\020\036\022\010\n\004JSON\020\037\022\n\n\006VE"
"CTOR\020 \022\010\n\004LIST\020(\022\n\n\006STRUCT\020)\022\016\n\nDICTIONA"
"RY\020**H\n\010TimeUnit\022\017\n\013MILLISECOND\020\000\022\n\n\006SEC"
"OND\020\001\022\017\n\013MICROSECOND\020\002\022\016\n\nNANOSECOND\020\003*$"
"\n\021JsonTypeExtension\022\017\n\013JSON_BINARY\020\000BO\n\016"
"io.greptime.v1B\006CommonZ5github.com/Grept"
"imeTeam/greptime-proto/go/greptime/v1b\006p"
"roto3"
;
static ::_pbi::once_flag descriptor_table_greptime_2fv1_2fcommon_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_greptime_2fv1_2fcommon_2eproto = {
false, false, 4046, descriptor_table_protodef_greptime_2fv1_2fcommon_2eproto,
false, false, 4085, descriptor_table_protodef_greptime_2fv1_2fcommon_2eproto,
"greptime/v1/common.proto",
&descriptor_table_greptime_2fv1_2fcommon_2eproto_once, nullptr, 0, 34,
&descriptor_table_greptime_2fv1_2fcommon_2eproto_once, nullptr, 0, 35,
schemas, file_default_instances, TableStruct_greptime_2fv1_2fcommon_2eproto::offsets,
file_level_metadata_greptime_2fv1_2fcommon_2eproto, file_level_enum_descriptors_greptime_2fv1_2fcommon_2eproto,
file_level_service_descriptors_greptime_2fv1_2fcommon_2eproto,
@@ -8538,6 +8561,184 @@ void ArrowIpc::InternalSwap(ArrowIpc* other) {
file_level_metadata_greptime_2fv1_2fcommon_2eproto[33]);
}
// ===================================================================
class PartitionRuleVersion::_Internal {
public:
};
PartitionRuleVersion::PartitionRuleVersion(::PROTOBUF_NAMESPACE_ID::Arena* arena,
bool is_message_owned)
: ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
SharedCtor(arena, is_message_owned);
// @@protoc_insertion_point(arena_constructor:greptime.v1.PartitionRuleVersion)
}
PartitionRuleVersion::PartitionRuleVersion(const PartitionRuleVersion& from)
: ::PROTOBUF_NAMESPACE_ID::Message() {
PartitionRuleVersion* const _this = this; (void)_this;
new (&_impl_) Impl_{
decltype(_impl_.value_){}
, /*decltype(_impl_._cached_size_)*/{}};
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
_this->_impl_.value_ = from._impl_.value_;
// @@protoc_insertion_point(copy_constructor:greptime.v1.PartitionRuleVersion)
}
inline void PartitionRuleVersion::SharedCtor(
::_pb::Arena* arena, bool is_message_owned) {
(void)arena;
(void)is_message_owned;
new (&_impl_) Impl_{
decltype(_impl_.value_){uint64_t{0u}}
, /*decltype(_impl_._cached_size_)*/{}
};
}
PartitionRuleVersion::~PartitionRuleVersion() {
// @@protoc_insertion_point(destructor:greptime.v1.PartitionRuleVersion)
if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
(void)arena;
return;
}
SharedDtor();
}
inline void PartitionRuleVersion::SharedDtor() {
GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
}
void PartitionRuleVersion::SetCachedSize(int size) const {
_impl_._cached_size_.Set(size);
}
void PartitionRuleVersion::Clear() {
// @@protoc_insertion_point(message_clear_start:greptime.v1.PartitionRuleVersion)
uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
_impl_.value_ = uint64_t{0u};
_internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}
const char* PartitionRuleVersion::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
uint32_t tag;
ptr = ::_pbi::ReadTag(ptr, &tag);
switch (tag >> 3) {
// uint64 value = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
_impl_.value_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
} else
goto handle_unusual;
continue;
default:
goto handle_unusual;
} // switch
handle_unusual:
if ((tag == 0) || ((tag & 7) == 4)) {
CHK_(ptr);
ctx->SetLastTag(tag);
goto message_done;
}
ptr = UnknownFieldParse(
tag,
_internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
ptr, ctx);
CHK_(ptr != nullptr);
} // while
message_done:
return ptr;
failure:
ptr = nullptr;
goto message_done;
#undef CHK_
}
uint8_t* PartitionRuleVersion::_InternalSerialize(
uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:greptime.v1.PartitionRuleVersion)
uint32_t cached_has_bits = 0;
(void) cached_has_bits;
// uint64 value = 1;
if (this->_internal_value() != 0) {
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_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);
}
// @@protoc_insertion_point(serialize_to_array_end:greptime.v1.PartitionRuleVersion)
return target;
}
size_t PartitionRuleVersion::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:greptime.v1.PartitionRuleVersion)
size_t total_size = 0;
uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// uint64 value = 1;
if (this->_internal_value() != 0) {
total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_value());
}
return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData PartitionRuleVersion::_class_data_ = {
::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
PartitionRuleVersion::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*PartitionRuleVersion::GetClassData() const { return &_class_data_; }
void PartitionRuleVersion::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
auto* const _this = static_cast<PartitionRuleVersion*>(&to_msg);
auto& from = static_cast<const PartitionRuleVersion&>(from_msg);
// @@protoc_insertion_point(class_specific_merge_from_start:greptime.v1.PartitionRuleVersion)
GOOGLE_DCHECK_NE(&from, _this);
uint32_t cached_has_bits = 0;
(void) cached_has_bits;
if (from._internal_value() != 0) {
_this->_internal_set_value(from._internal_value());
}
_this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}
void PartitionRuleVersion::CopyFrom(const PartitionRuleVersion& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:greptime.v1.PartitionRuleVersion)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool PartitionRuleVersion::IsInitialized() const {
return true;
}
void PartitionRuleVersion::InternalSwap(PartitionRuleVersion* other) {
using std::swap;
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
swap(_impl_.value_, other->_impl_.value_);
}
::PROTOBUF_NAMESPACE_ID::Metadata PartitionRuleVersion::GetMetadata() const {
return ::_pbi::AssignDescriptors(
&descriptor_table_greptime_2fv1_2fcommon_2eproto_getter, &descriptor_table_greptime_2fv1_2fcommon_2eproto_once,
file_level_metadata_greptime_2fv1_2fcommon_2eproto[34]);
}
// @@protoc_insertion_point(namespace_scope)
} // namespace v1
} // namespace greptime
@@ -8678,6 +8879,10 @@ template<> PROTOBUF_NOINLINE ::greptime::v1::ArrowIpc*
Arena::CreateMaybeMessage< ::greptime::v1::ArrowIpc >(Arena* arena) {
return Arena::CreateMessageInternal< ::greptime::v1::ArrowIpc >(arena);
}
template<> PROTOBUF_NOINLINE ::greptime::v1::PartitionRuleVersion*
Arena::CreateMaybeMessage< ::greptime::v1::PartitionRuleVersion >(Arena* arena) {
return Arena::CreateMessageInternal< ::greptime::v1::PartitionRuleVersion >(arena);
}
PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)