feat: add duration column. (#105)

This commit is contained in:
Wei
2023-09-18 19:08:44 +08:00
committed by GitHub
parent 637c54338f
commit 9d3f28d07d
15 changed files with 2292 additions and 59 deletions
+191 -8
View File
@@ -70,6 +70,14 @@ PROTOBUF_CONSTEXPR Column_Values::Column_Values(
, /*decltype(_impl_.interval_day_time_values_)*/{}
, /*decltype(_impl_._interval_day_time_values_cached_byte_size_)*/{0}
, /*decltype(_impl_.interval_month_day_nano_values_)*/{}
, /*decltype(_impl_.duration_second_values_)*/{}
, /*decltype(_impl_._duration_second_values_cached_byte_size_)*/{0}
, /*decltype(_impl_.duration_millisecond_values_)*/{}
, /*decltype(_impl_._duration_millisecond_values_cached_byte_size_)*/{0}
, /*decltype(_impl_.duration_microsecond_values_)*/{}
, /*decltype(_impl_._duration_microsecond_values_cached_byte_size_)*/{0}
, /*decltype(_impl_.duration_nanosecond_values_)*/{}
, /*decltype(_impl_._duration_nanosecond_values_cached_byte_size_)*/{0}
, /*decltype(_impl_._cached_size_)*/{}} {}
struct Column_ValuesDefaultTypeInternal {
PROTOBUF_CONSTEXPR Column_ValuesDefaultTypeInternal()
@@ -136,6 +144,10 @@ const uint32_t TableStruct_greptime_2fv1_2fcolumn_2eproto::offsets[] PROTOBUF_SE
PROTOBUF_FIELD_OFFSET(::greptime::v1::Column_Values, _impl_.interval_year_month_values_),
PROTOBUF_FIELD_OFFSET(::greptime::v1::Column_Values, _impl_.interval_day_time_values_),
PROTOBUF_FIELD_OFFSET(::greptime::v1::Column_Values, _impl_.interval_month_day_nano_values_),
PROTOBUF_FIELD_OFFSET(::greptime::v1::Column_Values, _impl_.duration_second_values_),
PROTOBUF_FIELD_OFFSET(::greptime::v1::Column_Values, _impl_.duration_millisecond_values_),
PROTOBUF_FIELD_OFFSET(::greptime::v1::Column_Values, _impl_.duration_microsecond_values_),
PROTOBUF_FIELD_OFFSET(::greptime::v1::Column_Values, _impl_.duration_nanosecond_values_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::greptime::v1::Column, _internal_metadata_),
~0u, // no _extensions_
@@ -150,7 +162,7 @@ const uint32_t TableStruct_greptime_2fv1_2fcolumn_2eproto::offsets[] PROTOBUF_SE
};
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{ 0, -1, -1, sizeof(::greptime::v1::Column_Values)},
{ 32, -1, -1, sizeof(::greptime::v1::Column)},
{ 36, -1, -1, sizeof(::greptime::v1::Column)},
};
static const ::_pb::Message* const file_default_instances[] = {
@@ -160,12 +172,12 @@ static const ::_pb::Message* const file_default_instances[] = {
const char descriptor_table_protodef_greptime_2fv1_2fcolumn_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
"\n\030greptime/v1/column.proto\022\013greptime.v1\032"
"\030greptime/v1/common.proto\"\240\007\n\006Column\022\023\n\013"
"\030greptime/v1/common.proto\"\256\010\n\006Column\022\023\n\013"
"column_name\030\001 \001(\t\0220\n\rsemantic_type\030\002 \001(\016"
"2\031.greptime.v1.SemanticType\022*\n\006values\030\003 "
"\001(\0132\032.greptime.v1.Column.Values\022\021\n\tnull_"
"mask\030\004 \001(\014\022-\n\010datatype\030\005 \001(\0162\033.greptime."
"v1.ColumnDataType\032\340\005\n\006Values\022\021\n\ti8_value"
"v1.ColumnDataType\032\356\006\n\006Values\022\021\n\ti8_value"
"s\030\001 \003(\005\022\022\n\ni16_values\030\002 \003(\005\022\022\n\ni32_value"
"s\030\003 \003(\005\022\022\n\ni64_values\030\004 \003(\003\022\021\n\tu8_values"
"\030\005 \003(\r\022\022\n\nu16_values\030\006 \003(\r\022\022\n\nu32_values"
@@ -183,17 +195,20 @@ const char descriptor_table_protodef_greptime_2fv1_2fcolumn_2eproto[] PROTOBUF_S
"alues\030\027 \003(\003\022\"\n\032interval_year_month_value"
"s\030\030 \003(\005\022 \n\030interval_day_time_values\030\031 \003("
"\003\022I\n\036interval_month_day_nano_values\030\032 \003("
"\0132!.greptime.v1.IntervalMonthDayNanoBP\n\016"
"io.greptime.v1B\007ColumnsZ5github.com/Grep"
"timeTeam/greptime-proto/go/greptime/v1b\006"
"proto3"
"\0132!.greptime.v1.IntervalMonthDayNano\022\036\n\026"
"duration_second_values\030\033 \003(\003\022#\n\033duration"
"_millisecond_values\030\034 \003(\003\022#\n\033duration_mi"
"crosecond_values\030\035 \003(\003\022\"\n\032duration_nanos"
"econd_values\030\036 \003(\003BP\n\016io.greptime.v1B\007Co"
"lumnsZ5github.com/GreptimeTeam/greptime-"
"proto/go/greptime/v1b\006proto3"
;
static const ::_pbi::DescriptorTable* const descriptor_table_greptime_2fv1_2fcolumn_2eproto_deps[1] = {
&::descriptor_table_greptime_2fv1_2fcommon_2eproto,
};
static ::_pbi::once_flag descriptor_table_greptime_2fv1_2fcolumn_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_greptime_2fv1_2fcolumn_2eproto = {
false, false, 1086, descriptor_table_protodef_greptime_2fv1_2fcolumn_2eproto,
false, false, 1228, descriptor_table_protodef_greptime_2fv1_2fcolumn_2eproto,
"greptime/v1/column.proto",
&descriptor_table_greptime_2fv1_2fcolumn_2eproto_once, descriptor_table_greptime_2fv1_2fcolumn_2eproto_deps, 1, 2,
schemas, file_default_instances, TableStruct_greptime_2fv1_2fcolumn_2eproto::offsets,
@@ -274,6 +289,14 @@ Column_Values::Column_Values(const Column_Values& from)
, decltype(_impl_.interval_day_time_values_){from._impl_.interval_day_time_values_}
, /*decltype(_impl_._interval_day_time_values_cached_byte_size_)*/{0}
, decltype(_impl_.interval_month_day_nano_values_){from._impl_.interval_month_day_nano_values_}
, decltype(_impl_.duration_second_values_){from._impl_.duration_second_values_}
, /*decltype(_impl_._duration_second_values_cached_byte_size_)*/{0}
, decltype(_impl_.duration_millisecond_values_){from._impl_.duration_millisecond_values_}
, /*decltype(_impl_._duration_millisecond_values_cached_byte_size_)*/{0}
, decltype(_impl_.duration_microsecond_values_){from._impl_.duration_microsecond_values_}
, /*decltype(_impl_._duration_microsecond_values_cached_byte_size_)*/{0}
, decltype(_impl_.duration_nanosecond_values_){from._impl_.duration_nanosecond_values_}
, /*decltype(_impl_._duration_nanosecond_values_cached_byte_size_)*/{0}
, /*decltype(_impl_._cached_size_)*/{}};
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
@@ -331,6 +354,14 @@ inline void Column_Values::SharedCtor(
, decltype(_impl_.interval_day_time_values_){arena}
, /*decltype(_impl_._interval_day_time_values_cached_byte_size_)*/{0}
, decltype(_impl_.interval_month_day_nano_values_){arena}
, decltype(_impl_.duration_second_values_){arena}
, /*decltype(_impl_._duration_second_values_cached_byte_size_)*/{0}
, decltype(_impl_.duration_millisecond_values_){arena}
, /*decltype(_impl_._duration_millisecond_values_cached_byte_size_)*/{0}
, decltype(_impl_.duration_microsecond_values_){arena}
, /*decltype(_impl_._duration_microsecond_values_cached_byte_size_)*/{0}
, decltype(_impl_.duration_nanosecond_values_){arena}
, /*decltype(_impl_._duration_nanosecond_values_cached_byte_size_)*/{0}
, /*decltype(_impl_._cached_size_)*/{}
};
}
@@ -372,6 +403,10 @@ inline void Column_Values::SharedDtor() {
_impl_.interval_year_month_values_.~RepeatedField();
_impl_.interval_day_time_values_.~RepeatedField();
_impl_.interval_month_day_nano_values_.~RepeatedPtrField();
_impl_.duration_second_values_.~RepeatedField();
_impl_.duration_millisecond_values_.~RepeatedField();
_impl_.duration_microsecond_values_.~RepeatedField();
_impl_.duration_nanosecond_values_.~RepeatedField();
}
void Column_Values::SetCachedSize(int size) const {
@@ -410,6 +445,10 @@ void Column_Values::Clear() {
_impl_.interval_year_month_values_.Clear();
_impl_.interval_day_time_values_.Clear();
_impl_.interval_month_day_nano_values_.Clear();
_impl_.duration_second_values_.Clear();
_impl_.duration_millisecond_values_.Clear();
_impl_.duration_microsecond_values_.Clear();
_impl_.duration_nanosecond_values_.Clear();
_internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}
@@ -714,6 +753,50 @@ const char* Column_Values::_InternalParse(const char* ptr, ::_pbi::ParseContext*
} else
goto handle_unusual;
continue;
// repeated int64 duration_second_values = 27;
case 27:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 218)) {
ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt64Parser(_internal_mutable_duration_second_values(), ptr, ctx);
CHK_(ptr);
} else if (static_cast<uint8_t>(tag) == 216) {
_internal_add_duration_second_values(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
CHK_(ptr);
} else
goto handle_unusual;
continue;
// repeated int64 duration_millisecond_values = 28;
case 28:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 226)) {
ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt64Parser(_internal_mutable_duration_millisecond_values(), ptr, ctx);
CHK_(ptr);
} else if (static_cast<uint8_t>(tag) == 224) {
_internal_add_duration_millisecond_values(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
CHK_(ptr);
} else
goto handle_unusual;
continue;
// repeated int64 duration_microsecond_values = 29;
case 29:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 234)) {
ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt64Parser(_internal_mutable_duration_microsecond_values(), ptr, ctx);
CHK_(ptr);
} else if (static_cast<uint8_t>(tag) == 232) {
_internal_add_duration_microsecond_values(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
CHK_(ptr);
} else
goto handle_unusual;
continue;
// repeated int64 duration_nanosecond_values = 30;
case 30:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 242)) {
ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt64Parser(_internal_mutable_duration_nanosecond_values(), ptr, ctx);
CHK_(ptr);
} else if (static_cast<uint8_t>(tag) == 240) {
_internal_add_duration_nanosecond_values(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
CHK_(ptr);
} else
goto handle_unusual;
continue;
default:
goto handle_unusual;
} // switch
@@ -962,6 +1045,42 @@ uint8_t* Column_Values::_InternalSerialize(
InternalWriteMessage(26, repfield, repfield.GetCachedSize(), target, stream);
}
// repeated int64 duration_second_values = 27;
{
int byte_size = _impl_._duration_second_values_cached_byte_size_.load(std::memory_order_relaxed);
if (byte_size > 0) {
target = stream->WriteInt64Packed(
27, _internal_duration_second_values(), byte_size, target);
}
}
// repeated int64 duration_millisecond_values = 28;
{
int byte_size = _impl_._duration_millisecond_values_cached_byte_size_.load(std::memory_order_relaxed);
if (byte_size > 0) {
target = stream->WriteInt64Packed(
28, _internal_duration_millisecond_values(), byte_size, target);
}
}
// repeated int64 duration_microsecond_values = 29;
{
int byte_size = _impl_._duration_microsecond_values_cached_byte_size_.load(std::memory_order_relaxed);
if (byte_size > 0) {
target = stream->WriteInt64Packed(
29, _internal_duration_microsecond_values(), byte_size, target);
}
}
// repeated int64 duration_nanosecond_values = 30;
{
int byte_size = _impl_._duration_nanosecond_values_cached_byte_size_.load(std::memory_order_relaxed);
if (byte_size > 0) {
target = stream->WriteInt64Packed(
30, _internal_duration_nanosecond_values(), byte_size, 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);
@@ -1314,6 +1433,62 @@ size_t Column_Values::ByteSizeLong() const {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
}
// repeated int64 duration_second_values = 27;
{
size_t data_size = ::_pbi::WireFormatLite::
Int64Size(this->_impl_.duration_second_values_);
if (data_size > 0) {
total_size += 2 +
::_pbi::WireFormatLite::Int32Size(static_cast<int32_t>(data_size));
}
int cached_size = ::_pbi::ToCachedSize(data_size);
_impl_._duration_second_values_cached_byte_size_.store(cached_size,
std::memory_order_relaxed);
total_size += data_size;
}
// repeated int64 duration_millisecond_values = 28;
{
size_t data_size = ::_pbi::WireFormatLite::
Int64Size(this->_impl_.duration_millisecond_values_);
if (data_size > 0) {
total_size += 2 +
::_pbi::WireFormatLite::Int32Size(static_cast<int32_t>(data_size));
}
int cached_size = ::_pbi::ToCachedSize(data_size);
_impl_._duration_millisecond_values_cached_byte_size_.store(cached_size,
std::memory_order_relaxed);
total_size += data_size;
}
// repeated int64 duration_microsecond_values = 29;
{
size_t data_size = ::_pbi::WireFormatLite::
Int64Size(this->_impl_.duration_microsecond_values_);
if (data_size > 0) {
total_size += 2 +
::_pbi::WireFormatLite::Int32Size(static_cast<int32_t>(data_size));
}
int cached_size = ::_pbi::ToCachedSize(data_size);
_impl_._duration_microsecond_values_cached_byte_size_.store(cached_size,
std::memory_order_relaxed);
total_size += data_size;
}
// repeated int64 duration_nanosecond_values = 30;
{
size_t data_size = ::_pbi::WireFormatLite::
Int64Size(this->_impl_.duration_nanosecond_values_);
if (data_size > 0) {
total_size += 2 +
::_pbi::WireFormatLite::Int32Size(static_cast<int32_t>(data_size));
}
int cached_size = ::_pbi::ToCachedSize(data_size);
_impl_._duration_nanosecond_values_cached_byte_size_.store(cached_size,
std::memory_order_relaxed);
total_size += data_size;
}
return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}
@@ -1358,6 +1533,10 @@ void Column_Values::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::
_this->_impl_.interval_year_month_values_.MergeFrom(from._impl_.interval_year_month_values_);
_this->_impl_.interval_day_time_values_.MergeFrom(from._impl_.interval_day_time_values_);
_this->_impl_.interval_month_day_nano_values_.MergeFrom(from._impl_.interval_month_day_nano_values_);
_this->_impl_.duration_second_values_.MergeFrom(from._impl_.duration_second_values_);
_this->_impl_.duration_millisecond_values_.MergeFrom(from._impl_.duration_millisecond_values_);
_this->_impl_.duration_microsecond_values_.MergeFrom(from._impl_.duration_microsecond_values_);
_this->_impl_.duration_nanosecond_values_.MergeFrom(from._impl_.duration_nanosecond_values_);
_this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}
@@ -1401,6 +1580,10 @@ void Column_Values::InternalSwap(Column_Values* other) {
_impl_.interval_year_month_values_.InternalSwap(&other->_impl_.interval_year_month_values_);
_impl_.interval_day_time_values_.InternalSwap(&other->_impl_.interval_day_time_values_);
_impl_.interval_month_day_nano_values_.InternalSwap(&other->_impl_.interval_month_day_nano_values_);
_impl_.duration_second_values_.InternalSwap(&other->_impl_.duration_second_values_);
_impl_.duration_millisecond_values_.InternalSwap(&other->_impl_.duration_millisecond_values_);
_impl_.duration_microsecond_values_.InternalSwap(&other->_impl_.duration_microsecond_values_);
_impl_.duration_nanosecond_values_.InternalSwap(&other->_impl_.duration_nanosecond_values_);
}
::PROTOBUF_NAMESPACE_ID::Metadata Column_Values::GetMetadata() const {