From cc56a6cdac20be64ffeac512ab71141e9b85b320 Mon Sep 17 00:00:00 2001 From: Ruihang Xia Date: Mon, 4 Aug 2025 01:27:00 -0700 Subject: [PATCH] feat: absent function in PromQL (#263) Signed-off-by: Ruihang Xia --- c++/substrait_extension/promql_plan.pb.cc | 705 ++++- c++/substrait_extension/promql_plan.pb.h | 711 +++++ go/substrait_extension/promql_plan.pb.go | 214 +- .../java/substrait_extension/PromqlPlan.java | 2305 ++++++++++++++++- proto/substrait_extension/promql_plan.proto | 20 + 5 files changed, 3935 insertions(+), 20 deletions(-) diff --git a/c++/substrait_extension/promql_plan.pb.cc b/c++/substrait_extension/promql_plan.pb.cc index 80d958e..d8cd448 100644 --- a/c++/substrait_extension/promql_plan.pb.cc +++ b/c++/substrait_extension/promql_plan.pb.cc @@ -120,8 +120,40 @@ struct ScalarCalculateDefaultTypeInternal { }; }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ScalarCalculateDefaultTypeInternal _ScalarCalculate_default_instance_; +PROTOBUF_CONSTEXPR Absent::Absent( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.fake_labels_)*/{} + , /*decltype(_impl_.time_index_column_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.value_column_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.start_)*/int64_t{0} + , /*decltype(_impl_.end_)*/int64_t{0} + , /*decltype(_impl_.step_)*/int64_t{0} + , /*decltype(_impl_._cached_size_)*/{}} {} +struct AbsentDefaultTypeInternal { + PROTOBUF_CONSTEXPR AbsentDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~AbsentDefaultTypeInternal() {} + union { + Absent _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 AbsentDefaultTypeInternal _Absent_default_instance_; +PROTOBUF_CONSTEXPR LabelPair::LabelPair( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.key_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.value_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_._cached_size_)*/{}} {} +struct LabelPairDefaultTypeInternal { + PROTOBUF_CONSTEXPR LabelPairDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~LabelPairDefaultTypeInternal() {} + union { + LabelPair _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 LabelPairDefaultTypeInternal _LabelPair_default_instance_; } // namespace substrait_extension -static ::_pb::Metadata file_level_metadata_substrait_5fextension_2fpromql_5fplan_2eproto[6]; +static ::_pb::Metadata file_level_metadata_substrait_5fextension_2fpromql_5fplan_2eproto[8]; static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_substrait_5fextension_2fpromql_5fplan_2eproto = nullptr; static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_substrait_5fextension_2fpromql_5fplan_2eproto = nullptr; @@ -189,6 +221,26 @@ const uint32_t TableStruct_substrait_5fextension_2fpromql_5fplan_2eproto::offset PROTOBUF_FIELD_OFFSET(::substrait_extension::ScalarCalculate, _impl_.time_index_), PROTOBUF_FIELD_OFFSET(::substrait_extension::ScalarCalculate, _impl_.tag_columns_), PROTOBUF_FIELD_OFFSET(::substrait_extension::ScalarCalculate, _impl_.field_column_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::substrait_extension::Absent, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::substrait_extension::Absent, _impl_.start_), + PROTOBUF_FIELD_OFFSET(::substrait_extension::Absent, _impl_.end_), + PROTOBUF_FIELD_OFFSET(::substrait_extension::Absent, _impl_.step_), + PROTOBUF_FIELD_OFFSET(::substrait_extension::Absent, _impl_.time_index_column_), + PROTOBUF_FIELD_OFFSET(::substrait_extension::Absent, _impl_.value_column_), + PROTOBUF_FIELD_OFFSET(::substrait_extension::Absent, _impl_.fake_labels_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::substrait_extension::LabelPair, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::substrait_extension::LabelPair, _impl_.key_), + PROTOBUF_FIELD_OFFSET(::substrait_extension::LabelPair, _impl_.value_), }; static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { { 0, -1, -1, sizeof(::substrait_extension::EmptyMetric)}, @@ -197,6 +249,8 @@ static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protode { 31, -1, -1, sizeof(::substrait_extension::SeriesDivide)}, { 39, -1, -1, sizeof(::substrait_extension::RangeManipulate)}, { 51, -1, -1, sizeof(::substrait_extension::ScalarCalculate)}, + { 63, -1, -1, sizeof(::substrait_extension::Absent)}, + { 75, -1, -1, sizeof(::substrait_extension::LabelPair)}, }; static const ::_pb::Message* const file_default_instances[] = { @@ -206,6 +260,8 @@ static const ::_pb::Message* const file_default_instances[] = { &::substrait_extension::_SeriesDivide_default_instance_._instance, &::substrait_extension::_RangeManipulate_default_instance_._instance, &::substrait_extension::_ScalarCalculate_default_instance_._instance, + &::substrait_extension::_Absent_default_instance_._instance, + &::substrait_extension::_LabelPair_default_instance_._instance, }; const char descriptor_table_protodef_substrait_5fextension_2fpromql_5fplan_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = @@ -225,15 +281,20 @@ const char descriptor_table_protodef_substrait_5fextension_2fpromql_5fplan_2epro "g_columns\030\006 \003(\t\"~\n\017ScalarCalculate\022\r\n\005st" "art\030\001 \001(\003\022\013\n\003end\030\002 \001(\003\022\020\n\010interval\030\003 \001(\003" "\022\022\n\ntime_index\030\005 \001(\t\022\023\n\013tag_columns\030\006 \003(" - "\t\022\024\n\014field_column\030\007 \001(\tB\?Z=github.com/Gr" - "eptimeTeam/greptime-proto/go/substrait_e" - "xtensionb\006proto3" + "\t\022\024\n\014field_column\030\007 \001(\t\"\230\001\n\006Absent\022\r\n\005st" + "art\030\001 \001(\003\022\013\n\003end\030\002 \001(\003\022\014\n\004step\030\003 \001(\003\022\031\n\021" + "time_index_column\030\004 \001(\t\022\024\n\014value_column\030" + "\005 \001(\t\0223\n\013fake_labels\030\006 \003(\0132\036.substrait_e" + "xtension.LabelPair\"\'\n\tLabelPair\022\013\n\003key\030\001" + " \001(\t\022\r\n\005value\030\002 \001(\tB\?Z=github.com/Grepti" + "meTeam/greptime-proto/go/substrait_exten" + "sionb\006proto3" ; static ::_pbi::once_flag descriptor_table_substrait_5fextension_2fpromql_5fplan_2eproto_once; const ::_pbi::DescriptorTable descriptor_table_substrait_5fextension_2fpromql_5fplan_2eproto = { - false, false, 736, descriptor_table_protodef_substrait_5fextension_2fpromql_5fplan_2eproto, + false, false, 932, descriptor_table_protodef_substrait_5fextension_2fpromql_5fplan_2eproto, "substrait_extension/promql_plan.proto", - &descriptor_table_substrait_5fextension_2fpromql_5fplan_2eproto_once, nullptr, 0, 6, + &descriptor_table_substrait_5fextension_2fpromql_5fplan_2eproto_once, nullptr, 0, 8, schemas, file_default_instances, TableStruct_substrait_5fextension_2fpromql_5fplan_2eproto::offsets, file_level_metadata_substrait_5fextension_2fpromql_5fplan_2eproto, file_level_enum_descriptors_substrait_5fextension_2fpromql_5fplan_2eproto, file_level_service_descriptors_substrait_5fextension_2fpromql_5fplan_2eproto, @@ -2112,6 +2173,630 @@ void ScalarCalculate::InternalSwap(ScalarCalculate* other) { file_level_metadata_substrait_5fextension_2fpromql_5fplan_2eproto[5]); } +// =================================================================== + +class Absent::_Internal { + public: +}; + +Absent::Absent(::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:substrait_extension.Absent) +} +Absent::Absent(const Absent& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + Absent* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.fake_labels_){from._impl_.fake_labels_} + , decltype(_impl_.time_index_column_){} + , decltype(_impl_.value_column_){} + , decltype(_impl_.start_){} + , decltype(_impl_.end_){} + , decltype(_impl_.step_){} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _impl_.time_index_column_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.time_index_column_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (!from._internal_time_index_column().empty()) { + _this->_impl_.time_index_column_.Set(from._internal_time_index_column(), + _this->GetArenaForAllocation()); + } + _impl_.value_column_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.value_column_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (!from._internal_value_column().empty()) { + _this->_impl_.value_column_.Set(from._internal_value_column(), + _this->GetArenaForAllocation()); + } + ::memcpy(&_impl_.start_, &from._impl_.start_, + static_cast(reinterpret_cast(&_impl_.step_) - + reinterpret_cast(&_impl_.start_)) + sizeof(_impl_.step_)); + // @@protoc_insertion_point(copy_constructor:substrait_extension.Absent) +} + +inline void Absent::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.fake_labels_){arena} + , decltype(_impl_.time_index_column_){} + , decltype(_impl_.value_column_){} + , decltype(_impl_.start_){int64_t{0}} + , decltype(_impl_.end_){int64_t{0}} + , decltype(_impl_.step_){int64_t{0}} + , /*decltype(_impl_._cached_size_)*/{} + }; + _impl_.time_index_column_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.time_index_column_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.value_column_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.value_column_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} + +Absent::~Absent() { + // @@protoc_insertion_point(destructor:substrait_extension.Absent) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void Absent::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.fake_labels_.~RepeatedPtrField(); + _impl_.time_index_column_.Destroy(); + _impl_.value_column_.Destroy(); +} + +void Absent::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void Absent::Clear() { +// @@protoc_insertion_point(message_clear_start:substrait_extension.Absent) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.fake_labels_.Clear(); + _impl_.time_index_column_.ClearToEmpty(); + _impl_.value_column_.ClearToEmpty(); + ::memset(&_impl_.start_, 0, static_cast( + reinterpret_cast(&_impl_.step_) - + reinterpret_cast(&_impl_.start_)) + sizeof(_impl_.step_)); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* Absent::_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) { + // int64 start = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + _impl_.start_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // int64 end = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { + _impl_.end_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // int64 step = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { + _impl_.step_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // string time_index_column = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { + auto str = _internal_mutable_time_index_column(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "substrait_extension.Absent.time_index_column")); + } else + goto handle_unusual; + continue; + // string value_column = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { + auto str = _internal_mutable_value_column(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "substrait_extension.Absent.value_column")); + } else + goto handle_unusual; + continue; + // repeated .substrait_extension.LabelPair fake_labels = 6; + case 6: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 50)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(_internal_add_fake_labels(), ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<50>(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* Absent::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:substrait_extension.Absent) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // int64 start = 1; + if (this->_internal_start() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteInt64ToArray(1, this->_internal_start(), target); + } + + // int64 end = 2; + if (this->_internal_end() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteInt64ToArray(2, this->_internal_end(), target); + } + + // int64 step = 3; + if (this->_internal_step() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteInt64ToArray(3, this->_internal_step(), target); + } + + // string time_index_column = 4; + if (!this->_internal_time_index_column().empty()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_time_index_column().data(), static_cast(this->_internal_time_index_column().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "substrait_extension.Absent.time_index_column"); + target = stream->WriteStringMaybeAliased( + 4, this->_internal_time_index_column(), target); + } + + // string value_column = 5; + if (!this->_internal_value_column().empty()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_value_column().data(), static_cast(this->_internal_value_column().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "substrait_extension.Absent.value_column"); + target = stream->WriteStringMaybeAliased( + 5, this->_internal_value_column(), target); + } + + // repeated .substrait_extension.LabelPair fake_labels = 6; + for (unsigned i = 0, + n = static_cast(this->_internal_fake_labels_size()); i < n; i++) { + const auto& repfield = this->_internal_fake_labels(i); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(6, repfield, repfield.GetCachedSize(), target, stream); + } + + 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:substrait_extension.Absent) + return target; +} + +size_t Absent::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:substrait_extension.Absent) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // repeated .substrait_extension.LabelPair fake_labels = 6; + total_size += 1UL * this->_internal_fake_labels_size(); + for (const auto& msg : this->_impl_.fake_labels_) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); + } + + // string time_index_column = 4; + if (!this->_internal_time_index_column().empty()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_time_index_column()); + } + + // string value_column = 5; + if (!this->_internal_value_column().empty()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_value_column()); + } + + // int64 start = 1; + if (this->_internal_start() != 0) { + total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_start()); + } + + // int64 end = 2; + if (this->_internal_end() != 0) { + total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_end()); + } + + // int64 step = 3; + if (this->_internal_step() != 0) { + total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_step()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Absent::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + Absent::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Absent::GetClassData() const { return &_class_data_; } + + +void Absent::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:substrait_extension.Absent) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + _this->_impl_.fake_labels_.MergeFrom(from._impl_.fake_labels_); + if (!from._internal_time_index_column().empty()) { + _this->_internal_set_time_index_column(from._internal_time_index_column()); + } + if (!from._internal_value_column().empty()) { + _this->_internal_set_value_column(from._internal_value_column()); + } + if (from._internal_start() != 0) { + _this->_internal_set_start(from._internal_start()); + } + if (from._internal_end() != 0) { + _this->_internal_set_end(from._internal_end()); + } + if (from._internal_step() != 0) { + _this->_internal_set_step(from._internal_step()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void Absent::CopyFrom(const Absent& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:substrait_extension.Absent) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Absent::IsInitialized() const { + return true; +} + +void Absent::InternalSwap(Absent* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + _impl_.fake_labels_.InternalSwap(&other->_impl_.fake_labels_); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.time_index_column_, lhs_arena, + &other->_impl_.time_index_column_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.value_column_, lhs_arena, + &other->_impl_.value_column_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(Absent, _impl_.step_) + + sizeof(Absent::_impl_.step_) + - PROTOBUF_FIELD_OFFSET(Absent, _impl_.start_)>( + reinterpret_cast(&_impl_.start_), + reinterpret_cast(&other->_impl_.start_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata Absent::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_substrait_5fextension_2fpromql_5fplan_2eproto_getter, &descriptor_table_substrait_5fextension_2fpromql_5fplan_2eproto_once, + file_level_metadata_substrait_5fextension_2fpromql_5fplan_2eproto[6]); +} + +// =================================================================== + +class LabelPair::_Internal { + public: +}; + +LabelPair::LabelPair(::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:substrait_extension.LabelPair) +} +LabelPair::LabelPair(const LabelPair& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + LabelPair* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.key_){} + , decltype(_impl_.value_){} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _impl_.key_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.key_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (!from._internal_key().empty()) { + _this->_impl_.key_.Set(from._internal_key(), + _this->GetArenaForAllocation()); + } + _impl_.value_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.value_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (!from._internal_value().empty()) { + _this->_impl_.value_.Set(from._internal_value(), + _this->GetArenaForAllocation()); + } + // @@protoc_insertion_point(copy_constructor:substrait_extension.LabelPair) +} + +inline void LabelPair::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.key_){} + , decltype(_impl_.value_){} + , /*decltype(_impl_._cached_size_)*/{} + }; + _impl_.key_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.key_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.value_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.value_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} + +LabelPair::~LabelPair() { + // @@protoc_insertion_point(destructor:substrait_extension.LabelPair) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void LabelPair::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.key_.Destroy(); + _impl_.value_.Destroy(); +} + +void LabelPair::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void LabelPair::Clear() { +// @@protoc_insertion_point(message_clear_start:substrait_extension.LabelPair) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.key_.ClearToEmpty(); + _impl_.value_.ClearToEmpty(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* LabelPair::_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) { + // string key = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + auto str = _internal_mutable_key(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "substrait_extension.LabelPair.key")); + } else + goto handle_unusual; + continue; + // string value = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + auto str = _internal_mutable_value(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "substrait_extension.LabelPair.value")); + } 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* LabelPair::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:substrait_extension.LabelPair) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // string key = 1; + if (!this->_internal_key().empty()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_key().data(), static_cast(this->_internal_key().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "substrait_extension.LabelPair.key"); + target = stream->WriteStringMaybeAliased( + 1, this->_internal_key(), target); + } + + // string value = 2; + if (!this->_internal_value().empty()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_value().data(), static_cast(this->_internal_value().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "substrait_extension.LabelPair.value"); + target = stream->WriteStringMaybeAliased( + 2, 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:substrait_extension.LabelPair) + return target; +} + +size_t LabelPair::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:substrait_extension.LabelPair) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // string key = 1; + if (!this->_internal_key().empty()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_key()); + } + + // string value = 2; + if (!this->_internal_value().empty()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_value()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData LabelPair::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + LabelPair::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*LabelPair::GetClassData() const { return &_class_data_; } + + +void LabelPair::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:substrait_extension.LabelPair) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (!from._internal_key().empty()) { + _this->_internal_set_key(from._internal_key()); + } + if (!from._internal_value().empty()) { + _this->_internal_set_value(from._internal_value()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void LabelPair::CopyFrom(const LabelPair& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:substrait_extension.LabelPair) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool LabelPair::IsInitialized() const { + return true; +} + +void LabelPair::InternalSwap(LabelPair* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.key_, lhs_arena, + &other->_impl_.key_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.value_, lhs_arena, + &other->_impl_.value_, rhs_arena + ); +} + +::PROTOBUF_NAMESPACE_ID::Metadata LabelPair::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_substrait_5fextension_2fpromql_5fplan_2eproto_getter, &descriptor_table_substrait_5fextension_2fpromql_5fplan_2eproto_once, + file_level_metadata_substrait_5fextension_2fpromql_5fplan_2eproto[7]); +} + // @@protoc_insertion_point(namespace_scope) } // namespace substrait_extension PROTOBUF_NAMESPACE_OPEN @@ -2139,6 +2824,14 @@ template<> PROTOBUF_NOINLINE ::substrait_extension::ScalarCalculate* Arena::CreateMaybeMessage< ::substrait_extension::ScalarCalculate >(Arena* arena) { return Arena::CreateMessageInternal< ::substrait_extension::ScalarCalculate >(arena); } +template<> PROTOBUF_NOINLINE ::substrait_extension::Absent* +Arena::CreateMaybeMessage< ::substrait_extension::Absent >(Arena* arena) { + return Arena::CreateMessageInternal< ::substrait_extension::Absent >(arena); +} +template<> PROTOBUF_NOINLINE ::substrait_extension::LabelPair* +Arena::CreateMaybeMessage< ::substrait_extension::LabelPair >(Arena* arena) { + return Arena::CreateMessageInternal< ::substrait_extension::LabelPair >(arena); +} PROTOBUF_NAMESPACE_CLOSE // @@protoc_insertion_point(global_scope) diff --git a/c++/substrait_extension/promql_plan.pb.h b/c++/substrait_extension/promql_plan.pb.h index 05c4719..747a7e0 100644 --- a/c++/substrait_extension/promql_plan.pb.h +++ b/c++/substrait_extension/promql_plan.pb.h @@ -45,12 +45,18 @@ struct TableStruct_substrait_5fextension_2fpromql_5fplan_2eproto { }; extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_substrait_5fextension_2fpromql_5fplan_2eproto; namespace substrait_extension { +class Absent; +struct AbsentDefaultTypeInternal; +extern AbsentDefaultTypeInternal _Absent_default_instance_; class EmptyMetric; struct EmptyMetricDefaultTypeInternal; extern EmptyMetricDefaultTypeInternal _EmptyMetric_default_instance_; class InstantManipulate; struct InstantManipulateDefaultTypeInternal; extern InstantManipulateDefaultTypeInternal _InstantManipulate_default_instance_; +class LabelPair; +struct LabelPairDefaultTypeInternal; +extern LabelPairDefaultTypeInternal _LabelPair_default_instance_; class RangeManipulate; struct RangeManipulateDefaultTypeInternal; extern RangeManipulateDefaultTypeInternal _RangeManipulate_default_instance_; @@ -65,8 +71,10 @@ struct SeriesNormalizeDefaultTypeInternal; extern SeriesNormalizeDefaultTypeInternal _SeriesNormalize_default_instance_; } // namespace substrait_extension PROTOBUF_NAMESPACE_OPEN +template<> ::substrait_extension::Absent* Arena::CreateMaybeMessage<::substrait_extension::Absent>(Arena*); template<> ::substrait_extension::EmptyMetric* Arena::CreateMaybeMessage<::substrait_extension::EmptyMetric>(Arena*); template<> ::substrait_extension::InstantManipulate* Arena::CreateMaybeMessage<::substrait_extension::InstantManipulate>(Arena*); +template<> ::substrait_extension::LabelPair* Arena::CreateMaybeMessage<::substrait_extension::LabelPair>(Arena*); template<> ::substrait_extension::RangeManipulate* Arena::CreateMaybeMessage<::substrait_extension::RangeManipulate>(Arena*); template<> ::substrait_extension::ScalarCalculate* Arena::CreateMaybeMessage<::substrait_extension::ScalarCalculate>(Arena*); template<> ::substrait_extension::SeriesDivide* Arena::CreateMaybeMessage<::substrait_extension::SeriesDivide>(Arena*); @@ -1288,6 +1296,397 @@ class ScalarCalculate final : union { Impl_ _impl_; }; friend struct ::TableStruct_substrait_5fextension_2fpromql_5fplan_2eproto; }; +// ------------------------------------------------------------------- + +class Absent final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:substrait_extension.Absent) */ { + public: + inline Absent() : Absent(nullptr) {} + ~Absent() override; + explicit PROTOBUF_CONSTEXPR Absent(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + Absent(const Absent& from); + Absent(Absent&& from) noexcept + : Absent() { + *this = ::std::move(from); + } + + inline Absent& operator=(const Absent& from) { + CopyFrom(from); + return *this; + } + inline Absent& operator=(Absent&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const Absent& default_instance() { + return *internal_default_instance(); + } + static inline const Absent* internal_default_instance() { + return reinterpret_cast( + &_Absent_default_instance_); + } + static constexpr int kIndexInFileMessages = + 6; + + friend void swap(Absent& a, Absent& b) { + a.Swap(&b); + } + inline void Swap(Absent* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(Absent* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + Absent* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const Absent& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const Absent& from) { + Absent::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Absent* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "substrait_extension.Absent"; + } + protected: + explicit Absent(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kFakeLabelsFieldNumber = 6, + kTimeIndexColumnFieldNumber = 4, + kValueColumnFieldNumber = 5, + kStartFieldNumber = 1, + kEndFieldNumber = 2, + kStepFieldNumber = 3, + }; + // repeated .substrait_extension.LabelPair fake_labels = 6; + int fake_labels_size() const; + private: + int _internal_fake_labels_size() const; + public: + void clear_fake_labels(); + ::substrait_extension::LabelPair* mutable_fake_labels(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::substrait_extension::LabelPair >* + mutable_fake_labels(); + private: + const ::substrait_extension::LabelPair& _internal_fake_labels(int index) const; + ::substrait_extension::LabelPair* _internal_add_fake_labels(); + public: + const ::substrait_extension::LabelPair& fake_labels(int index) const; + ::substrait_extension::LabelPair* add_fake_labels(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::substrait_extension::LabelPair >& + fake_labels() const; + + // string time_index_column = 4; + void clear_time_index_column(); + const std::string& time_index_column() const; + template + void set_time_index_column(ArgT0&& arg0, ArgT... args); + std::string* mutable_time_index_column(); + PROTOBUF_NODISCARD std::string* release_time_index_column(); + void set_allocated_time_index_column(std::string* time_index_column); + private: + const std::string& _internal_time_index_column() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_time_index_column(const std::string& value); + std::string* _internal_mutable_time_index_column(); + public: + + // string value_column = 5; + void clear_value_column(); + const std::string& value_column() const; + template + void set_value_column(ArgT0&& arg0, ArgT... args); + std::string* mutable_value_column(); + PROTOBUF_NODISCARD std::string* release_value_column(); + void set_allocated_value_column(std::string* value_column); + private: + const std::string& _internal_value_column() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_value_column(const std::string& value); + std::string* _internal_mutable_value_column(); + public: + + // int64 start = 1; + void clear_start(); + int64_t start() const; + void set_start(int64_t value); + private: + int64_t _internal_start() const; + void _internal_set_start(int64_t value); + public: + + // int64 end = 2; + void clear_end(); + int64_t end() const; + void set_end(int64_t value); + private: + int64_t _internal_end() const; + void _internal_set_end(int64_t value); + public: + + // int64 step = 3; + void clear_step(); + int64_t step() const; + void set_step(int64_t value); + private: + int64_t _internal_step() const; + void _internal_set_step(int64_t value); + public: + + // @@protoc_insertion_point(class_scope:substrait_extension.Absent) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::substrait_extension::LabelPair > fake_labels_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr time_index_column_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr value_column_; + int64_t start_; + int64_t end_; + int64_t step_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_substrait_5fextension_2fpromql_5fplan_2eproto; +}; +// ------------------------------------------------------------------- + +class LabelPair final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:substrait_extension.LabelPair) */ { + public: + inline LabelPair() : LabelPair(nullptr) {} + ~LabelPair() override; + explicit PROTOBUF_CONSTEXPR LabelPair(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + LabelPair(const LabelPair& from); + LabelPair(LabelPair&& from) noexcept + : LabelPair() { + *this = ::std::move(from); + } + + inline LabelPair& operator=(const LabelPair& from) { + CopyFrom(from); + return *this; + } + inline LabelPair& operator=(LabelPair&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const LabelPair& default_instance() { + return *internal_default_instance(); + } + static inline const LabelPair* internal_default_instance() { + return reinterpret_cast( + &_LabelPair_default_instance_); + } + static constexpr int kIndexInFileMessages = + 7; + + friend void swap(LabelPair& a, LabelPair& b) { + a.Swap(&b); + } + inline void Swap(LabelPair* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(LabelPair* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + LabelPair* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const LabelPair& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const LabelPair& from) { + LabelPair::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(LabelPair* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "substrait_extension.LabelPair"; + } + protected: + explicit LabelPair(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kKeyFieldNumber = 1, + kValueFieldNumber = 2, + }; + // string key = 1; + void clear_key(); + const std::string& key() const; + template + void set_key(ArgT0&& arg0, ArgT... args); + std::string* mutable_key(); + PROTOBUF_NODISCARD std::string* release_key(); + void set_allocated_key(std::string* key); + private: + const std::string& _internal_key() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_key(const std::string& value); + std::string* _internal_mutable_key(); + public: + + // string value = 2; + void clear_value(); + const std::string& value() const; + template + void set_value(ArgT0&& arg0, ArgT... args); + std::string* mutable_value(); + PROTOBUF_NODISCARD std::string* release_value(); + void set_allocated_value(std::string* value); + private: + const std::string& _internal_value() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_value(const std::string& value); + std::string* _internal_mutable_value(); + public: + + // @@protoc_insertion_point(class_scope:substrait_extension.LabelPair) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr key_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr value_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_substrait_5fextension_2fpromql_5fplan_2eproto; +}; // =================================================================== @@ -2289,6 +2688,314 @@ inline void ScalarCalculate::set_allocated_field_column(std::string* field_colum // @@protoc_insertion_point(field_set_allocated:substrait_extension.ScalarCalculate.field_column) } +// ------------------------------------------------------------------- + +// Absent + +// int64 start = 1; +inline void Absent::clear_start() { + _impl_.start_ = int64_t{0}; +} +inline int64_t Absent::_internal_start() const { + return _impl_.start_; +} +inline int64_t Absent::start() const { + // @@protoc_insertion_point(field_get:substrait_extension.Absent.start) + return _internal_start(); +} +inline void Absent::_internal_set_start(int64_t value) { + + _impl_.start_ = value; +} +inline void Absent::set_start(int64_t value) { + _internal_set_start(value); + // @@protoc_insertion_point(field_set:substrait_extension.Absent.start) +} + +// int64 end = 2; +inline void Absent::clear_end() { + _impl_.end_ = int64_t{0}; +} +inline int64_t Absent::_internal_end() const { + return _impl_.end_; +} +inline int64_t Absent::end() const { + // @@protoc_insertion_point(field_get:substrait_extension.Absent.end) + return _internal_end(); +} +inline void Absent::_internal_set_end(int64_t value) { + + _impl_.end_ = value; +} +inline void Absent::set_end(int64_t value) { + _internal_set_end(value); + // @@protoc_insertion_point(field_set:substrait_extension.Absent.end) +} + +// int64 step = 3; +inline void Absent::clear_step() { + _impl_.step_ = int64_t{0}; +} +inline int64_t Absent::_internal_step() const { + return _impl_.step_; +} +inline int64_t Absent::step() const { + // @@protoc_insertion_point(field_get:substrait_extension.Absent.step) + return _internal_step(); +} +inline void Absent::_internal_set_step(int64_t value) { + + _impl_.step_ = value; +} +inline void Absent::set_step(int64_t value) { + _internal_set_step(value); + // @@protoc_insertion_point(field_set:substrait_extension.Absent.step) +} + +// string time_index_column = 4; +inline void Absent::clear_time_index_column() { + _impl_.time_index_column_.ClearToEmpty(); +} +inline const std::string& Absent::time_index_column() const { + // @@protoc_insertion_point(field_get:substrait_extension.Absent.time_index_column) + return _internal_time_index_column(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void Absent::set_time_index_column(ArgT0&& arg0, ArgT... args) { + + _impl_.time_index_column_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:substrait_extension.Absent.time_index_column) +} +inline std::string* Absent::mutable_time_index_column() { + std::string* _s = _internal_mutable_time_index_column(); + // @@protoc_insertion_point(field_mutable:substrait_extension.Absent.time_index_column) + return _s; +} +inline const std::string& Absent::_internal_time_index_column() const { + return _impl_.time_index_column_.Get(); +} +inline void Absent::_internal_set_time_index_column(const std::string& value) { + + _impl_.time_index_column_.Set(value, GetArenaForAllocation()); +} +inline std::string* Absent::_internal_mutable_time_index_column() { + + return _impl_.time_index_column_.Mutable(GetArenaForAllocation()); +} +inline std::string* Absent::release_time_index_column() { + // @@protoc_insertion_point(field_release:substrait_extension.Absent.time_index_column) + return _impl_.time_index_column_.Release(); +} +inline void Absent::set_allocated_time_index_column(std::string* time_index_column) { + if (time_index_column != nullptr) { + + } else { + + } + _impl_.time_index_column_.SetAllocated(time_index_column, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.time_index_column_.IsDefault()) { + _impl_.time_index_column_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:substrait_extension.Absent.time_index_column) +} + +// string value_column = 5; +inline void Absent::clear_value_column() { + _impl_.value_column_.ClearToEmpty(); +} +inline const std::string& Absent::value_column() const { + // @@protoc_insertion_point(field_get:substrait_extension.Absent.value_column) + return _internal_value_column(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void Absent::set_value_column(ArgT0&& arg0, ArgT... args) { + + _impl_.value_column_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:substrait_extension.Absent.value_column) +} +inline std::string* Absent::mutable_value_column() { + std::string* _s = _internal_mutable_value_column(); + // @@protoc_insertion_point(field_mutable:substrait_extension.Absent.value_column) + return _s; +} +inline const std::string& Absent::_internal_value_column() const { + return _impl_.value_column_.Get(); +} +inline void Absent::_internal_set_value_column(const std::string& value) { + + _impl_.value_column_.Set(value, GetArenaForAllocation()); +} +inline std::string* Absent::_internal_mutable_value_column() { + + return _impl_.value_column_.Mutable(GetArenaForAllocation()); +} +inline std::string* Absent::release_value_column() { + // @@protoc_insertion_point(field_release:substrait_extension.Absent.value_column) + return _impl_.value_column_.Release(); +} +inline void Absent::set_allocated_value_column(std::string* value_column) { + if (value_column != nullptr) { + + } else { + + } + _impl_.value_column_.SetAllocated(value_column, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.value_column_.IsDefault()) { + _impl_.value_column_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:substrait_extension.Absent.value_column) +} + +// repeated .substrait_extension.LabelPair fake_labels = 6; +inline int Absent::_internal_fake_labels_size() const { + return _impl_.fake_labels_.size(); +} +inline int Absent::fake_labels_size() const { + return _internal_fake_labels_size(); +} +inline void Absent::clear_fake_labels() { + _impl_.fake_labels_.Clear(); +} +inline ::substrait_extension::LabelPair* Absent::mutable_fake_labels(int index) { + // @@protoc_insertion_point(field_mutable:substrait_extension.Absent.fake_labels) + return _impl_.fake_labels_.Mutable(index); +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::substrait_extension::LabelPair >* +Absent::mutable_fake_labels() { + // @@protoc_insertion_point(field_mutable_list:substrait_extension.Absent.fake_labels) + return &_impl_.fake_labels_; +} +inline const ::substrait_extension::LabelPair& Absent::_internal_fake_labels(int index) const { + return _impl_.fake_labels_.Get(index); +} +inline const ::substrait_extension::LabelPair& Absent::fake_labels(int index) const { + // @@protoc_insertion_point(field_get:substrait_extension.Absent.fake_labels) + return _internal_fake_labels(index); +} +inline ::substrait_extension::LabelPair* Absent::_internal_add_fake_labels() { + return _impl_.fake_labels_.Add(); +} +inline ::substrait_extension::LabelPair* Absent::add_fake_labels() { + ::substrait_extension::LabelPair* _add = _internal_add_fake_labels(); + // @@protoc_insertion_point(field_add:substrait_extension.Absent.fake_labels) + return _add; +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::substrait_extension::LabelPair >& +Absent::fake_labels() const { + // @@protoc_insertion_point(field_list:substrait_extension.Absent.fake_labels) + return _impl_.fake_labels_; +} + +// ------------------------------------------------------------------- + +// LabelPair + +// string key = 1; +inline void LabelPair::clear_key() { + _impl_.key_.ClearToEmpty(); +} +inline const std::string& LabelPair::key() const { + // @@protoc_insertion_point(field_get:substrait_extension.LabelPair.key) + return _internal_key(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void LabelPair::set_key(ArgT0&& arg0, ArgT... args) { + + _impl_.key_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:substrait_extension.LabelPair.key) +} +inline std::string* LabelPair::mutable_key() { + std::string* _s = _internal_mutable_key(); + // @@protoc_insertion_point(field_mutable:substrait_extension.LabelPair.key) + return _s; +} +inline const std::string& LabelPair::_internal_key() const { + return _impl_.key_.Get(); +} +inline void LabelPair::_internal_set_key(const std::string& value) { + + _impl_.key_.Set(value, GetArenaForAllocation()); +} +inline std::string* LabelPair::_internal_mutable_key() { + + return _impl_.key_.Mutable(GetArenaForAllocation()); +} +inline std::string* LabelPair::release_key() { + // @@protoc_insertion_point(field_release:substrait_extension.LabelPair.key) + return _impl_.key_.Release(); +} +inline void LabelPair::set_allocated_key(std::string* key) { + if (key != nullptr) { + + } else { + + } + _impl_.key_.SetAllocated(key, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.key_.IsDefault()) { + _impl_.key_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:substrait_extension.LabelPair.key) +} + +// string value = 2; +inline void LabelPair::clear_value() { + _impl_.value_.ClearToEmpty(); +} +inline const std::string& LabelPair::value() const { + // @@protoc_insertion_point(field_get:substrait_extension.LabelPair.value) + return _internal_value(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void LabelPair::set_value(ArgT0&& arg0, ArgT... args) { + + _impl_.value_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:substrait_extension.LabelPair.value) +} +inline std::string* LabelPair::mutable_value() { + std::string* _s = _internal_mutable_value(); + // @@protoc_insertion_point(field_mutable:substrait_extension.LabelPair.value) + return _s; +} +inline const std::string& LabelPair::_internal_value() const { + return _impl_.value_.Get(); +} +inline void LabelPair::_internal_set_value(const std::string& value) { + + _impl_.value_.Set(value, GetArenaForAllocation()); +} +inline std::string* LabelPair::_internal_mutable_value() { + + return _impl_.value_.Mutable(GetArenaForAllocation()); +} +inline std::string* LabelPair::release_value() { + // @@protoc_insertion_point(field_release:substrait_extension.LabelPair.value) + return _impl_.value_.Release(); +} +inline void LabelPair::set_allocated_value(std::string* value) { + if (value != nullptr) { + + } else { + + } + _impl_.value_.SetAllocated(value, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.value_.IsDefault()) { + _impl_.value_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:substrait_extension.LabelPair.value) +} + #ifdef __GNUC__ #pragma GCC diagnostic pop #endif // __GNUC__ @@ -2302,6 +3009,10 @@ inline void ScalarCalculate::set_allocated_field_column(std::string* field_colum // ------------------------------------------------------------------- +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + // @@protoc_insertion_point(namespace_scope) diff --git a/go/substrait_extension/promql_plan.pb.go b/go/substrait_extension/promql_plan.pb.go index fb5d8f8..95d9dcd 100644 --- a/go/substrait_extension/promql_plan.pb.go +++ b/go/substrait_extension/promql_plan.pb.go @@ -511,6 +511,154 @@ func (x *ScalarCalculate) GetFieldColumn() string { return "" } +type Absent struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Start timestamp in millisecond + Start int64 `protobuf:"varint,1,opt,name=start,proto3" json:"start,omitempty"` + // End timestamp in millisecond + End int64 `protobuf:"varint,2,opt,name=end,proto3" json:"end,omitempty"` + // Step in millisecond + Step int64 `protobuf:"varint,3,opt,name=step,proto3" json:"step,omitempty"` + // Column name of time index column + TimeIndexColumn string `protobuf:"bytes,4,opt,name=time_index_column,json=timeIndexColumn,proto3" json:"time_index_column,omitempty"` + // Column name of value column + ValueColumn string `protobuf:"bytes,5,opt,name=value_column,json=valueColumn,proto3" json:"value_column,omitempty"` + // Fake labels as key-value pairs + FakeLabels []*LabelPair `protobuf:"bytes,6,rep,name=fake_labels,json=fakeLabels,proto3" json:"fake_labels,omitempty"` +} + +func (x *Absent) Reset() { + *x = Absent{} + if protoimpl.UnsafeEnabled { + mi := &file_substrait_extension_promql_plan_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Absent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Absent) ProtoMessage() {} + +func (x *Absent) ProtoReflect() protoreflect.Message { + mi := &file_substrait_extension_promql_plan_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Absent.ProtoReflect.Descriptor instead. +func (*Absent) Descriptor() ([]byte, []int) { + return file_substrait_extension_promql_plan_proto_rawDescGZIP(), []int{6} +} + +func (x *Absent) GetStart() int64 { + if x != nil { + return x.Start + } + return 0 +} + +func (x *Absent) GetEnd() int64 { + if x != nil { + return x.End + } + return 0 +} + +func (x *Absent) GetStep() int64 { + if x != nil { + return x.Step + } + return 0 +} + +func (x *Absent) GetTimeIndexColumn() string { + if x != nil { + return x.TimeIndexColumn + } + return "" +} + +func (x *Absent) GetValueColumn() string { + if x != nil { + return x.ValueColumn + } + return "" +} + +func (x *Absent) GetFakeLabels() []*LabelPair { + if x != nil { + return x.FakeLabels + } + return nil +} + +type LabelPair struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *LabelPair) Reset() { + *x = LabelPair{} + if protoimpl.UnsafeEnabled { + mi := &file_substrait_extension_promql_plan_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LabelPair) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LabelPair) ProtoMessage() {} + +func (x *LabelPair) ProtoReflect() protoreflect.Message { + mi := &file_substrait_extension_promql_plan_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LabelPair.ProtoReflect.Descriptor instead. +func (*LabelPair) Descriptor() ([]byte, []int) { + return file_substrait_extension_promql_plan_proto_rawDescGZIP(), []int{7} +} + +func (x *LabelPair) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *LabelPair) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + var File_substrait_extension_promql_plan_proto protoreflect.FileDescriptor var file_substrait_extension_promql_plan_proto_rawDesc = []byte{ @@ -572,11 +720,28 @@ var file_substrait_extension_promql_plan_proto_rawDesc = []byte{ 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x43, 0x6f, 0x6c, 0x75, 0x6d, - 0x6e, 0x42, 0x3f, 0x5a, 0x3d, 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, 0x73, + 0x6e, 0x22, 0xd4, 0x01, 0x0a, 0x06, 0x41, 0x62, 0x73, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x03, 0x65, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x74, 0x65, 0x70, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x04, 0x73, 0x74, 0x65, 0x70, 0x12, 0x2a, 0x0a, 0x11, 0x74, 0x69, 0x6d, 0x65, + 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0f, 0x74, 0x69, 0x6d, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x43, 0x6f, + 0x6c, 0x75, 0x6d, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x63, 0x6f, + 0x6c, 0x75, 0x6d, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x12, 0x3f, 0x0a, 0x0b, 0x66, 0x61, 0x6b, 0x65, 0x5f, + 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x74, 0x72, 0x61, 0x69, 0x74, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, - 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x6e, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x50, 0x61, 0x69, 0x72, 0x52, 0x0a, 0x66, 0x61, + 0x6b, 0x65, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x22, 0x33, 0x0a, 0x09, 0x4c, 0x61, 0x62, 0x65, + 0x6c, 0x50, 0x61, 0x69, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x3f, 0x5a, + 0x3d, 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, 0x73, 0x75, 0x62, 0x73, 0x74, + 0x72, 0x61, 0x69, 0x74, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -591,7 +756,7 @@ func file_substrait_extension_promql_plan_proto_rawDescGZIP() []byte { return file_substrait_extension_promql_plan_proto_rawDescData } -var file_substrait_extension_promql_plan_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_substrait_extension_promql_plan_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_substrait_extension_promql_plan_proto_goTypes = []interface{}{ (*EmptyMetric)(nil), // 0: substrait_extension.EmptyMetric (*InstantManipulate)(nil), // 1: substrait_extension.InstantManipulate @@ -599,13 +764,16 @@ var file_substrait_extension_promql_plan_proto_goTypes = []interface{}{ (*SeriesDivide)(nil), // 3: substrait_extension.SeriesDivide (*RangeManipulate)(nil), // 4: substrait_extension.RangeManipulate (*ScalarCalculate)(nil), // 5: substrait_extension.ScalarCalculate + (*Absent)(nil), // 6: substrait_extension.Absent + (*LabelPair)(nil), // 7: substrait_extension.LabelPair } var file_substrait_extension_promql_plan_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name + 7, // 0: substrait_extension.Absent.fake_labels:type_name -> substrait_extension.LabelPair + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name } func init() { file_substrait_extension_promql_plan_proto_init() } @@ -686,6 +854,30 @@ func file_substrait_extension_promql_plan_proto_init() { return nil } } + file_substrait_extension_promql_plan_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Absent); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_substrait_extension_promql_plan_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LabelPair); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -693,7 +885,7 @@ func file_substrait_extension_promql_plan_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_substrait_extension_promql_plan_proto_rawDesc, NumEnums: 0, - NumMessages: 6, + NumMessages: 8, NumExtensions: 0, NumServices: 0, }, diff --git a/java/src/main/java/substrait_extension/PromqlPlan.java b/java/src/main/java/substrait_extension/PromqlPlan.java index ab56d50..9f57760 100644 --- a/java/src/main/java/substrait_extension/PromqlPlan.java +++ b/java/src/main/java/substrait_extension/PromqlPlan.java @@ -6444,6 +6444,2278 @@ public final class PromqlPlan { } + public interface AbsentOrBuilder extends + // @@protoc_insertion_point(interface_extends:substrait_extension.Absent) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Start timestamp in millisecond
+     * 
+ * + * int64 start = 1; + * @return The start. + */ + long getStart(); + + /** + *
+     * End timestamp in millisecond
+     * 
+ * + * int64 end = 2; + * @return The end. + */ + long getEnd(); + + /** + *
+     * Step in millisecond
+     * 
+ * + * int64 step = 3; + * @return The step. + */ + long getStep(); + + /** + *
+     * Column name of time index column
+     * 
+ * + * string time_index_column = 4; + * @return The timeIndexColumn. + */ + java.lang.String getTimeIndexColumn(); + /** + *
+     * Column name of time index column
+     * 
+ * + * string time_index_column = 4; + * @return The bytes for timeIndexColumn. + */ + com.google.protobuf.ByteString + getTimeIndexColumnBytes(); + + /** + *
+     * Column name of value column
+     * 
+ * + * string value_column = 5; + * @return The valueColumn. + */ + java.lang.String getValueColumn(); + /** + *
+     * Column name of value column
+     * 
+ * + * string value_column = 5; + * @return The bytes for valueColumn. + */ + com.google.protobuf.ByteString + getValueColumnBytes(); + + /** + *
+     * Fake labels as key-value pairs
+     * 
+ * + * repeated .substrait_extension.LabelPair fake_labels = 6; + */ + java.util.List + getFakeLabelsList(); + /** + *
+     * Fake labels as key-value pairs
+     * 
+ * + * repeated .substrait_extension.LabelPair fake_labels = 6; + */ + substrait_extension.PromqlPlan.LabelPair getFakeLabels(int index); + /** + *
+     * Fake labels as key-value pairs
+     * 
+ * + * repeated .substrait_extension.LabelPair fake_labels = 6; + */ + int getFakeLabelsCount(); + /** + *
+     * Fake labels as key-value pairs
+     * 
+ * + * repeated .substrait_extension.LabelPair fake_labels = 6; + */ + java.util.List + getFakeLabelsOrBuilderList(); + /** + *
+     * Fake labels as key-value pairs
+     * 
+ * + * repeated .substrait_extension.LabelPair fake_labels = 6; + */ + substrait_extension.PromqlPlan.LabelPairOrBuilder getFakeLabelsOrBuilder( + int index); + } + /** + * Protobuf type {@code substrait_extension.Absent} + */ + public static final class Absent extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:substrait_extension.Absent) + AbsentOrBuilder { + private static final long serialVersionUID = 0L; + // Use Absent.newBuilder() to construct. + private Absent(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Absent() { + timeIndexColumn_ = ""; + valueColumn_ = ""; + fakeLabels_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Absent(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Absent( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + + start_ = input.readInt64(); + break; + } + case 16: { + + end_ = input.readInt64(); + break; + } + case 24: { + + step_ = input.readInt64(); + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + timeIndexColumn_ = s; + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + valueColumn_ = s; + break; + } + case 50: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + fakeLabels_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + fakeLabels_.add( + input.readMessage(substrait_extension.PromqlPlan.LabelPair.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + fakeLabels_ = java.util.Collections.unmodifiableList(fakeLabels_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return substrait_extension.PromqlPlan.internal_static_substrait_extension_Absent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return substrait_extension.PromqlPlan.internal_static_substrait_extension_Absent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + substrait_extension.PromqlPlan.Absent.class, substrait_extension.PromqlPlan.Absent.Builder.class); + } + + public static final int START_FIELD_NUMBER = 1; + private long start_; + /** + *
+     * Start timestamp in millisecond
+     * 
+ * + * int64 start = 1; + * @return The start. + */ + @java.lang.Override + public long getStart() { + return start_; + } + + public static final int END_FIELD_NUMBER = 2; + private long end_; + /** + *
+     * End timestamp in millisecond
+     * 
+ * + * int64 end = 2; + * @return The end. + */ + @java.lang.Override + public long getEnd() { + return end_; + } + + public static final int STEP_FIELD_NUMBER = 3; + private long step_; + /** + *
+     * Step in millisecond
+     * 
+ * + * int64 step = 3; + * @return The step. + */ + @java.lang.Override + public long getStep() { + return step_; + } + + public static final int TIME_INDEX_COLUMN_FIELD_NUMBER = 4; + private volatile java.lang.Object timeIndexColumn_; + /** + *
+     * Column name of time index column
+     * 
+ * + * string time_index_column = 4; + * @return The timeIndexColumn. + */ + @java.lang.Override + public java.lang.String getTimeIndexColumn() { + java.lang.Object ref = timeIndexColumn_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + timeIndexColumn_ = s; + return s; + } + } + /** + *
+     * Column name of time index column
+     * 
+ * + * string time_index_column = 4; + * @return The bytes for timeIndexColumn. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTimeIndexColumnBytes() { + java.lang.Object ref = timeIndexColumn_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + timeIndexColumn_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUE_COLUMN_FIELD_NUMBER = 5; + private volatile java.lang.Object valueColumn_; + /** + *
+     * Column name of value column
+     * 
+ * + * string value_column = 5; + * @return The valueColumn. + */ + @java.lang.Override + public java.lang.String getValueColumn() { + java.lang.Object ref = valueColumn_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + valueColumn_ = s; + return s; + } + } + /** + *
+     * Column name of value column
+     * 
+ * + * string value_column = 5; + * @return The bytes for valueColumn. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getValueColumnBytes() { + java.lang.Object ref = valueColumn_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + valueColumn_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FAKE_LABELS_FIELD_NUMBER = 6; + private java.util.List fakeLabels_; + /** + *
+     * Fake labels as key-value pairs
+     * 
+ * + * repeated .substrait_extension.LabelPair fake_labels = 6; + */ + @java.lang.Override + public java.util.List getFakeLabelsList() { + return fakeLabels_; + } + /** + *
+     * Fake labels as key-value pairs
+     * 
+ * + * repeated .substrait_extension.LabelPair fake_labels = 6; + */ + @java.lang.Override + public java.util.List + getFakeLabelsOrBuilderList() { + return fakeLabels_; + } + /** + *
+     * Fake labels as key-value pairs
+     * 
+ * + * repeated .substrait_extension.LabelPair fake_labels = 6; + */ + @java.lang.Override + public int getFakeLabelsCount() { + return fakeLabels_.size(); + } + /** + *
+     * Fake labels as key-value pairs
+     * 
+ * + * repeated .substrait_extension.LabelPair fake_labels = 6; + */ + @java.lang.Override + public substrait_extension.PromqlPlan.LabelPair getFakeLabels(int index) { + return fakeLabels_.get(index); + } + /** + *
+     * Fake labels as key-value pairs
+     * 
+ * + * repeated .substrait_extension.LabelPair fake_labels = 6; + */ + @java.lang.Override + public substrait_extension.PromqlPlan.LabelPairOrBuilder getFakeLabelsOrBuilder( + int index) { + return fakeLabels_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (start_ != 0L) { + output.writeInt64(1, start_); + } + if (end_ != 0L) { + output.writeInt64(2, end_); + } + if (step_ != 0L) { + output.writeInt64(3, step_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(timeIndexColumn_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, timeIndexColumn_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(valueColumn_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, valueColumn_); + } + for (int i = 0; i < fakeLabels_.size(); i++) { + output.writeMessage(6, fakeLabels_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (start_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, start_); + } + if (end_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, end_); + } + if (step_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(3, step_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(timeIndexColumn_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, timeIndexColumn_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(valueColumn_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, valueColumn_); + } + for (int i = 0; i < fakeLabels_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, fakeLabels_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof substrait_extension.PromqlPlan.Absent)) { + return super.equals(obj); + } + substrait_extension.PromqlPlan.Absent other = (substrait_extension.PromqlPlan.Absent) obj; + + if (getStart() + != other.getStart()) return false; + if (getEnd() + != other.getEnd()) return false; + if (getStep() + != other.getStep()) return false; + if (!getTimeIndexColumn() + .equals(other.getTimeIndexColumn())) return false; + if (!getValueColumn() + .equals(other.getValueColumn())) return false; + if (!getFakeLabelsList() + .equals(other.getFakeLabelsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + START_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getStart()); + hash = (37 * hash) + END_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getEnd()); + hash = (37 * hash) + STEP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getStep()); + hash = (37 * hash) + TIME_INDEX_COLUMN_FIELD_NUMBER; + hash = (53 * hash) + getTimeIndexColumn().hashCode(); + hash = (37 * hash) + VALUE_COLUMN_FIELD_NUMBER; + hash = (53 * hash) + getValueColumn().hashCode(); + if (getFakeLabelsCount() > 0) { + hash = (37 * hash) + FAKE_LABELS_FIELD_NUMBER; + hash = (53 * hash) + getFakeLabelsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static substrait_extension.PromqlPlan.Absent parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static substrait_extension.PromqlPlan.Absent parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static substrait_extension.PromqlPlan.Absent parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static substrait_extension.PromqlPlan.Absent parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static substrait_extension.PromqlPlan.Absent parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static substrait_extension.PromqlPlan.Absent parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static substrait_extension.PromqlPlan.Absent parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static substrait_extension.PromqlPlan.Absent parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static substrait_extension.PromqlPlan.Absent parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static substrait_extension.PromqlPlan.Absent parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static substrait_extension.PromqlPlan.Absent parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static substrait_extension.PromqlPlan.Absent parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(substrait_extension.PromqlPlan.Absent prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code substrait_extension.Absent} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:substrait_extension.Absent) + substrait_extension.PromqlPlan.AbsentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return substrait_extension.PromqlPlan.internal_static_substrait_extension_Absent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return substrait_extension.PromqlPlan.internal_static_substrait_extension_Absent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + substrait_extension.PromqlPlan.Absent.class, substrait_extension.PromqlPlan.Absent.Builder.class); + } + + // Construct using substrait_extension.PromqlPlan.Absent.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getFakeLabelsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + start_ = 0L; + + end_ = 0L; + + step_ = 0L; + + timeIndexColumn_ = ""; + + valueColumn_ = ""; + + if (fakeLabelsBuilder_ == null) { + fakeLabels_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + fakeLabelsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return substrait_extension.PromqlPlan.internal_static_substrait_extension_Absent_descriptor; + } + + @java.lang.Override + public substrait_extension.PromqlPlan.Absent getDefaultInstanceForType() { + return substrait_extension.PromqlPlan.Absent.getDefaultInstance(); + } + + @java.lang.Override + public substrait_extension.PromqlPlan.Absent build() { + substrait_extension.PromqlPlan.Absent result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public substrait_extension.PromqlPlan.Absent buildPartial() { + substrait_extension.PromqlPlan.Absent result = new substrait_extension.PromqlPlan.Absent(this); + int from_bitField0_ = bitField0_; + result.start_ = start_; + result.end_ = end_; + result.step_ = step_; + result.timeIndexColumn_ = timeIndexColumn_; + result.valueColumn_ = valueColumn_; + if (fakeLabelsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + fakeLabels_ = java.util.Collections.unmodifiableList(fakeLabels_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.fakeLabels_ = fakeLabels_; + } else { + result.fakeLabels_ = fakeLabelsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof substrait_extension.PromqlPlan.Absent) { + return mergeFrom((substrait_extension.PromqlPlan.Absent)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(substrait_extension.PromqlPlan.Absent other) { + if (other == substrait_extension.PromqlPlan.Absent.getDefaultInstance()) return this; + if (other.getStart() != 0L) { + setStart(other.getStart()); + } + if (other.getEnd() != 0L) { + setEnd(other.getEnd()); + } + if (other.getStep() != 0L) { + setStep(other.getStep()); + } + if (!other.getTimeIndexColumn().isEmpty()) { + timeIndexColumn_ = other.timeIndexColumn_; + onChanged(); + } + if (!other.getValueColumn().isEmpty()) { + valueColumn_ = other.valueColumn_; + onChanged(); + } + if (fakeLabelsBuilder_ == null) { + if (!other.fakeLabels_.isEmpty()) { + if (fakeLabels_.isEmpty()) { + fakeLabels_ = other.fakeLabels_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureFakeLabelsIsMutable(); + fakeLabels_.addAll(other.fakeLabels_); + } + onChanged(); + } + } else { + if (!other.fakeLabels_.isEmpty()) { + if (fakeLabelsBuilder_.isEmpty()) { + fakeLabelsBuilder_.dispose(); + fakeLabelsBuilder_ = null; + fakeLabels_ = other.fakeLabels_; + bitField0_ = (bitField0_ & ~0x00000001); + fakeLabelsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getFakeLabelsFieldBuilder() : null; + } else { + fakeLabelsBuilder_.addAllMessages(other.fakeLabels_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + substrait_extension.PromqlPlan.Absent parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (substrait_extension.PromqlPlan.Absent) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private long start_ ; + /** + *
+       * Start timestamp in millisecond
+       * 
+ * + * int64 start = 1; + * @return The start. + */ + @java.lang.Override + public long getStart() { + return start_; + } + /** + *
+       * Start timestamp in millisecond
+       * 
+ * + * int64 start = 1; + * @param value The start to set. + * @return This builder for chaining. + */ + public Builder setStart(long value) { + + start_ = value; + onChanged(); + return this; + } + /** + *
+       * Start timestamp in millisecond
+       * 
+ * + * int64 start = 1; + * @return This builder for chaining. + */ + public Builder clearStart() { + + start_ = 0L; + onChanged(); + return this; + } + + private long end_ ; + /** + *
+       * End timestamp in millisecond
+       * 
+ * + * int64 end = 2; + * @return The end. + */ + @java.lang.Override + public long getEnd() { + return end_; + } + /** + *
+       * End timestamp in millisecond
+       * 
+ * + * int64 end = 2; + * @param value The end to set. + * @return This builder for chaining. + */ + public Builder setEnd(long value) { + + end_ = value; + onChanged(); + return this; + } + /** + *
+       * End timestamp in millisecond
+       * 
+ * + * int64 end = 2; + * @return This builder for chaining. + */ + public Builder clearEnd() { + + end_ = 0L; + onChanged(); + return this; + } + + private long step_ ; + /** + *
+       * Step in millisecond
+       * 
+ * + * int64 step = 3; + * @return The step. + */ + @java.lang.Override + public long getStep() { + return step_; + } + /** + *
+       * Step in millisecond
+       * 
+ * + * int64 step = 3; + * @param value The step to set. + * @return This builder for chaining. + */ + public Builder setStep(long value) { + + step_ = value; + onChanged(); + return this; + } + /** + *
+       * Step in millisecond
+       * 
+ * + * int64 step = 3; + * @return This builder for chaining. + */ + public Builder clearStep() { + + step_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object timeIndexColumn_ = ""; + /** + *
+       * Column name of time index column
+       * 
+ * + * string time_index_column = 4; + * @return The timeIndexColumn. + */ + public java.lang.String getTimeIndexColumn() { + java.lang.Object ref = timeIndexColumn_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + timeIndexColumn_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * Column name of time index column
+       * 
+ * + * string time_index_column = 4; + * @return The bytes for timeIndexColumn. + */ + public com.google.protobuf.ByteString + getTimeIndexColumnBytes() { + java.lang.Object ref = timeIndexColumn_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + timeIndexColumn_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * Column name of time index column
+       * 
+ * + * string time_index_column = 4; + * @param value The timeIndexColumn to set. + * @return This builder for chaining. + */ + public Builder setTimeIndexColumn( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + timeIndexColumn_ = value; + onChanged(); + return this; + } + /** + *
+       * Column name of time index column
+       * 
+ * + * string time_index_column = 4; + * @return This builder for chaining. + */ + public Builder clearTimeIndexColumn() { + + timeIndexColumn_ = getDefaultInstance().getTimeIndexColumn(); + onChanged(); + return this; + } + /** + *
+       * Column name of time index column
+       * 
+ * + * string time_index_column = 4; + * @param value The bytes for timeIndexColumn to set. + * @return This builder for chaining. + */ + public Builder setTimeIndexColumnBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + timeIndexColumn_ = value; + onChanged(); + return this; + } + + private java.lang.Object valueColumn_ = ""; + /** + *
+       * Column name of value column
+       * 
+ * + * string value_column = 5; + * @return The valueColumn. + */ + public java.lang.String getValueColumn() { + java.lang.Object ref = valueColumn_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + valueColumn_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * Column name of value column
+       * 
+ * + * string value_column = 5; + * @return The bytes for valueColumn. + */ + public com.google.protobuf.ByteString + getValueColumnBytes() { + java.lang.Object ref = valueColumn_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + valueColumn_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * Column name of value column
+       * 
+ * + * string value_column = 5; + * @param value The valueColumn to set. + * @return This builder for chaining. + */ + public Builder setValueColumn( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + valueColumn_ = value; + onChanged(); + return this; + } + /** + *
+       * Column name of value column
+       * 
+ * + * string value_column = 5; + * @return This builder for chaining. + */ + public Builder clearValueColumn() { + + valueColumn_ = getDefaultInstance().getValueColumn(); + onChanged(); + return this; + } + /** + *
+       * Column name of value column
+       * 
+ * + * string value_column = 5; + * @param value The bytes for valueColumn to set. + * @return This builder for chaining. + */ + public Builder setValueColumnBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + valueColumn_ = value; + onChanged(); + return this; + } + + private java.util.List fakeLabels_ = + java.util.Collections.emptyList(); + private void ensureFakeLabelsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + fakeLabels_ = new java.util.ArrayList(fakeLabels_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + substrait_extension.PromqlPlan.LabelPair, substrait_extension.PromqlPlan.LabelPair.Builder, substrait_extension.PromqlPlan.LabelPairOrBuilder> fakeLabelsBuilder_; + + /** + *
+       * Fake labels as key-value pairs
+       * 
+ * + * repeated .substrait_extension.LabelPair fake_labels = 6; + */ + public java.util.List getFakeLabelsList() { + if (fakeLabelsBuilder_ == null) { + return java.util.Collections.unmodifiableList(fakeLabels_); + } else { + return fakeLabelsBuilder_.getMessageList(); + } + } + /** + *
+       * Fake labels as key-value pairs
+       * 
+ * + * repeated .substrait_extension.LabelPair fake_labels = 6; + */ + public int getFakeLabelsCount() { + if (fakeLabelsBuilder_ == null) { + return fakeLabels_.size(); + } else { + return fakeLabelsBuilder_.getCount(); + } + } + /** + *
+       * Fake labels as key-value pairs
+       * 
+ * + * repeated .substrait_extension.LabelPair fake_labels = 6; + */ + public substrait_extension.PromqlPlan.LabelPair getFakeLabels(int index) { + if (fakeLabelsBuilder_ == null) { + return fakeLabels_.get(index); + } else { + return fakeLabelsBuilder_.getMessage(index); + } + } + /** + *
+       * Fake labels as key-value pairs
+       * 
+ * + * repeated .substrait_extension.LabelPair fake_labels = 6; + */ + public Builder setFakeLabels( + int index, substrait_extension.PromqlPlan.LabelPair value) { + if (fakeLabelsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFakeLabelsIsMutable(); + fakeLabels_.set(index, value); + onChanged(); + } else { + fakeLabelsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+       * Fake labels as key-value pairs
+       * 
+ * + * repeated .substrait_extension.LabelPair fake_labels = 6; + */ + public Builder setFakeLabels( + int index, substrait_extension.PromqlPlan.LabelPair.Builder builderForValue) { + if (fakeLabelsBuilder_ == null) { + ensureFakeLabelsIsMutable(); + fakeLabels_.set(index, builderForValue.build()); + onChanged(); + } else { + fakeLabelsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * Fake labels as key-value pairs
+       * 
+ * + * repeated .substrait_extension.LabelPair fake_labels = 6; + */ + public Builder addFakeLabels(substrait_extension.PromqlPlan.LabelPair value) { + if (fakeLabelsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFakeLabelsIsMutable(); + fakeLabels_.add(value); + onChanged(); + } else { + fakeLabelsBuilder_.addMessage(value); + } + return this; + } + /** + *
+       * Fake labels as key-value pairs
+       * 
+ * + * repeated .substrait_extension.LabelPair fake_labels = 6; + */ + public Builder addFakeLabels( + int index, substrait_extension.PromqlPlan.LabelPair value) { + if (fakeLabelsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFakeLabelsIsMutable(); + fakeLabels_.add(index, value); + onChanged(); + } else { + fakeLabelsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+       * Fake labels as key-value pairs
+       * 
+ * + * repeated .substrait_extension.LabelPair fake_labels = 6; + */ + public Builder addFakeLabels( + substrait_extension.PromqlPlan.LabelPair.Builder builderForValue) { + if (fakeLabelsBuilder_ == null) { + ensureFakeLabelsIsMutable(); + fakeLabels_.add(builderForValue.build()); + onChanged(); + } else { + fakeLabelsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+       * Fake labels as key-value pairs
+       * 
+ * + * repeated .substrait_extension.LabelPair fake_labels = 6; + */ + public Builder addFakeLabels( + int index, substrait_extension.PromqlPlan.LabelPair.Builder builderForValue) { + if (fakeLabelsBuilder_ == null) { + ensureFakeLabelsIsMutable(); + fakeLabels_.add(index, builderForValue.build()); + onChanged(); + } else { + fakeLabelsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * Fake labels as key-value pairs
+       * 
+ * + * repeated .substrait_extension.LabelPair fake_labels = 6; + */ + public Builder addAllFakeLabels( + java.lang.Iterable values) { + if (fakeLabelsBuilder_ == null) { + ensureFakeLabelsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, fakeLabels_); + onChanged(); + } else { + fakeLabelsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+       * Fake labels as key-value pairs
+       * 
+ * + * repeated .substrait_extension.LabelPair fake_labels = 6; + */ + public Builder clearFakeLabels() { + if (fakeLabelsBuilder_ == null) { + fakeLabels_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + fakeLabelsBuilder_.clear(); + } + return this; + } + /** + *
+       * Fake labels as key-value pairs
+       * 
+ * + * repeated .substrait_extension.LabelPair fake_labels = 6; + */ + public Builder removeFakeLabels(int index) { + if (fakeLabelsBuilder_ == null) { + ensureFakeLabelsIsMutable(); + fakeLabels_.remove(index); + onChanged(); + } else { + fakeLabelsBuilder_.remove(index); + } + return this; + } + /** + *
+       * Fake labels as key-value pairs
+       * 
+ * + * repeated .substrait_extension.LabelPair fake_labels = 6; + */ + public substrait_extension.PromqlPlan.LabelPair.Builder getFakeLabelsBuilder( + int index) { + return getFakeLabelsFieldBuilder().getBuilder(index); + } + /** + *
+       * Fake labels as key-value pairs
+       * 
+ * + * repeated .substrait_extension.LabelPair fake_labels = 6; + */ + public substrait_extension.PromqlPlan.LabelPairOrBuilder getFakeLabelsOrBuilder( + int index) { + if (fakeLabelsBuilder_ == null) { + return fakeLabels_.get(index); } else { + return fakeLabelsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+       * Fake labels as key-value pairs
+       * 
+ * + * repeated .substrait_extension.LabelPair fake_labels = 6; + */ + public java.util.List + getFakeLabelsOrBuilderList() { + if (fakeLabelsBuilder_ != null) { + return fakeLabelsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(fakeLabels_); + } + } + /** + *
+       * Fake labels as key-value pairs
+       * 
+ * + * repeated .substrait_extension.LabelPair fake_labels = 6; + */ + public substrait_extension.PromqlPlan.LabelPair.Builder addFakeLabelsBuilder() { + return getFakeLabelsFieldBuilder().addBuilder( + substrait_extension.PromqlPlan.LabelPair.getDefaultInstance()); + } + /** + *
+       * Fake labels as key-value pairs
+       * 
+ * + * repeated .substrait_extension.LabelPair fake_labels = 6; + */ + public substrait_extension.PromqlPlan.LabelPair.Builder addFakeLabelsBuilder( + int index) { + return getFakeLabelsFieldBuilder().addBuilder( + index, substrait_extension.PromqlPlan.LabelPair.getDefaultInstance()); + } + /** + *
+       * Fake labels as key-value pairs
+       * 
+ * + * repeated .substrait_extension.LabelPair fake_labels = 6; + */ + public java.util.List + getFakeLabelsBuilderList() { + return getFakeLabelsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + substrait_extension.PromqlPlan.LabelPair, substrait_extension.PromqlPlan.LabelPair.Builder, substrait_extension.PromqlPlan.LabelPairOrBuilder> + getFakeLabelsFieldBuilder() { + if (fakeLabelsBuilder_ == null) { + fakeLabelsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + substrait_extension.PromqlPlan.LabelPair, substrait_extension.PromqlPlan.LabelPair.Builder, substrait_extension.PromqlPlan.LabelPairOrBuilder>( + fakeLabels_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + fakeLabels_ = null; + } + return fakeLabelsBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:substrait_extension.Absent) + } + + // @@protoc_insertion_point(class_scope:substrait_extension.Absent) + private static final substrait_extension.PromqlPlan.Absent DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new substrait_extension.PromqlPlan.Absent(); + } + + public static substrait_extension.PromqlPlan.Absent getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Absent parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Absent(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public substrait_extension.PromqlPlan.Absent getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface LabelPairOrBuilder extends + // @@protoc_insertion_point(interface_extends:substrait_extension.LabelPair) + com.google.protobuf.MessageOrBuilder { + + /** + * string key = 1; + * @return The key. + */ + java.lang.String getKey(); + /** + * string key = 1; + * @return The bytes for key. + */ + com.google.protobuf.ByteString + getKeyBytes(); + + /** + * string value = 2; + * @return The value. + */ + java.lang.String getValue(); + /** + * string value = 2; + * @return The bytes for value. + */ + com.google.protobuf.ByteString + getValueBytes(); + } + /** + * Protobuf type {@code substrait_extension.LabelPair} + */ + public static final class LabelPair extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:substrait_extension.LabelPair) + LabelPairOrBuilder { + private static final long serialVersionUID = 0L; + // Use LabelPair.newBuilder() to construct. + private LabelPair(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private LabelPair() { + key_ = ""; + value_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new LabelPair(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private LabelPair( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + key_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + value_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return substrait_extension.PromqlPlan.internal_static_substrait_extension_LabelPair_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return substrait_extension.PromqlPlan.internal_static_substrait_extension_LabelPair_fieldAccessorTable + .ensureFieldAccessorsInitialized( + substrait_extension.PromqlPlan.LabelPair.class, substrait_extension.PromqlPlan.LabelPair.Builder.class); + } + + public static final int KEY_FIELD_NUMBER = 1; + private volatile java.lang.Object key_; + /** + * string key = 1; + * @return The key. + */ + @java.lang.Override + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } + } + /** + * string key = 1; + * @return The bytes for key. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUE_FIELD_NUMBER = 2; + private volatile java.lang.Object value_; + /** + * string value = 2; + * @return The value. + */ + @java.lang.Override + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } + } + /** + * string value = 2; + * @return The bytes for value. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(key_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(value_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, value_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(key_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(value_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, value_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof substrait_extension.PromqlPlan.LabelPair)) { + return super.equals(obj); + } + substrait_extension.PromqlPlan.LabelPair other = (substrait_extension.PromqlPlan.LabelPair) obj; + + if (!getKey() + .equals(other.getKey())) return false; + if (!getValue() + .equals(other.getValue())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static substrait_extension.PromqlPlan.LabelPair parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static substrait_extension.PromqlPlan.LabelPair parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static substrait_extension.PromqlPlan.LabelPair parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static substrait_extension.PromqlPlan.LabelPair parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static substrait_extension.PromqlPlan.LabelPair parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static substrait_extension.PromqlPlan.LabelPair parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static substrait_extension.PromqlPlan.LabelPair parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static substrait_extension.PromqlPlan.LabelPair parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static substrait_extension.PromqlPlan.LabelPair parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static substrait_extension.PromqlPlan.LabelPair parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static substrait_extension.PromqlPlan.LabelPair parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static substrait_extension.PromqlPlan.LabelPair parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(substrait_extension.PromqlPlan.LabelPair prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code substrait_extension.LabelPair} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:substrait_extension.LabelPair) + substrait_extension.PromqlPlan.LabelPairOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return substrait_extension.PromqlPlan.internal_static_substrait_extension_LabelPair_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return substrait_extension.PromqlPlan.internal_static_substrait_extension_LabelPair_fieldAccessorTable + .ensureFieldAccessorsInitialized( + substrait_extension.PromqlPlan.LabelPair.class, substrait_extension.PromqlPlan.LabelPair.Builder.class); + } + + // Construct using substrait_extension.PromqlPlan.LabelPair.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + key_ = ""; + + value_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return substrait_extension.PromqlPlan.internal_static_substrait_extension_LabelPair_descriptor; + } + + @java.lang.Override + public substrait_extension.PromqlPlan.LabelPair getDefaultInstanceForType() { + return substrait_extension.PromqlPlan.LabelPair.getDefaultInstance(); + } + + @java.lang.Override + public substrait_extension.PromqlPlan.LabelPair build() { + substrait_extension.PromqlPlan.LabelPair result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public substrait_extension.PromqlPlan.LabelPair buildPartial() { + substrait_extension.PromqlPlan.LabelPair result = new substrait_extension.PromqlPlan.LabelPair(this); + result.key_ = key_; + result.value_ = value_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof substrait_extension.PromqlPlan.LabelPair) { + return mergeFrom((substrait_extension.PromqlPlan.LabelPair)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(substrait_extension.PromqlPlan.LabelPair other) { + if (other == substrait_extension.PromqlPlan.LabelPair.getDefaultInstance()) return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + onChanged(); + } + if (!other.getValue().isEmpty()) { + value_ = other.value_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + substrait_extension.PromqlPlan.LabelPair parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (substrait_extension.PromqlPlan.LabelPair) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object key_ = ""; + /** + * string key = 1; + * @return The key. + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string key = 1; + * @return The bytes for key. + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string key = 1; + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + key_ = value; + onChanged(); + return this; + } + /** + * string key = 1; + * @return This builder for chaining. + */ + public Builder clearKey() { + + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + * string key = 1; + * @param value The bytes for key to set. + * @return This builder for chaining. + */ + public Builder setKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + key_ = value; + onChanged(); + return this; + } + + private java.lang.Object value_ = ""; + /** + * string value = 2; + * @return The value. + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string value = 2; + * @return The bytes for value. + */ + public com.google.protobuf.ByteString + getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string value = 2; + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + value_ = value; + onChanged(); + return this; + } + /** + * string value = 2; + * @return This builder for chaining. + */ + public Builder clearValue() { + + value_ = getDefaultInstance().getValue(); + onChanged(); + return this; + } + /** + * string value = 2; + * @param value The bytes for value to set. + * @return This builder for chaining. + */ + public Builder setValueBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + value_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:substrait_extension.LabelPair) + } + + // @@protoc_insertion_point(class_scope:substrait_extension.LabelPair) + private static final substrait_extension.PromqlPlan.LabelPair DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new substrait_extension.PromqlPlan.LabelPair(); + } + + public static substrait_extension.PromqlPlan.LabelPair getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LabelPair parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LabelPair(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public substrait_extension.PromqlPlan.LabelPair getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + private static final com.google.protobuf.Descriptors.Descriptor internal_static_substrait_extension_EmptyMetric_descriptor; private static final @@ -6474,6 +8746,16 @@ public final class PromqlPlan { private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_substrait_extension_ScalarCalculate_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_substrait_extension_Absent_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_substrait_extension_Absent_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_substrait_extension_LabelPair_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_substrait_extension_LabelPair_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -6499,9 +8781,14 @@ public final class PromqlPlan { "g_columns\030\006 \003(\t\"~\n\017ScalarCalculate\022\r\n\005st" + "art\030\001 \001(\003\022\013\n\003end\030\002 \001(\003\022\020\n\010interval\030\003 \001(\003" + "\022\022\n\ntime_index\030\005 \001(\t\022\023\n\013tag_columns\030\006 \003(" + - "\t\022\024\n\014field_column\030\007 \001(\tB?Z=github.com/Gr" + - "eptimeTeam/greptime-proto/go/substrait_e" + - "xtensionb\006proto3" + "\t\022\024\n\014field_column\030\007 \001(\t\"\230\001\n\006Absent\022\r\n\005st" + + "art\030\001 \001(\003\022\013\n\003end\030\002 \001(\003\022\014\n\004step\030\003 \001(\003\022\031\n\021" + + "time_index_column\030\004 \001(\t\022\024\n\014value_column\030" + + "\005 \001(\t\0223\n\013fake_labels\030\006 \003(\0132\036.substrait_e" + + "xtension.LabelPair\"\'\n\tLabelPair\022\013\n\003key\030\001" + + " \001(\t\022\r\n\005value\030\002 \001(\tB?Z=github.com/Grepti" + + "meTeam/greptime-proto/go/substrait_exten" + + "sionb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -6543,6 +8830,18 @@ public final class PromqlPlan { com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_substrait_extension_ScalarCalculate_descriptor, new java.lang.String[] { "Start", "End", "Interval", "TimeIndex", "TagColumns", "FieldColumn", }); + internal_static_substrait_extension_Absent_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_substrait_extension_Absent_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_substrait_extension_Absent_descriptor, + new java.lang.String[] { "Start", "End", "Step", "TimeIndexColumn", "ValueColumn", "FakeLabels", }); + internal_static_substrait_extension_LabelPair_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_substrait_extension_LabelPair_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_substrait_extension_LabelPair_descriptor, + new java.lang.String[] { "Key", "Value", }); } // @@protoc_insertion_point(outer_class_scope) diff --git a/proto/substrait_extension/promql_plan.proto b/proto/substrait_extension/promql_plan.proto index c82ce5e..f554e2f 100644 --- a/proto/substrait_extension/promql_plan.proto +++ b/proto/substrait_extension/promql_plan.proto @@ -89,3 +89,23 @@ message ScalarCalculate { // Column name of field column string field_column = 7; } + +message Absent { + // Start timestamp in millisecond + int64 start = 1; + // End timestamp in millisecond + int64 end = 2; + // Step in millisecond + int64 step = 3; + // Column name of time index column + string time_index_column = 4; + // Column name of value column + string value_column = 5; + // Fake labels as key-value pairs + repeated LabelPair fake_labels = 6; +} + +message LabelPair { + string key = 1; + string value = 2; +}