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
+145 -5
View File
@@ -141,6 +141,10 @@ const uint32_t TableStruct_greptime_2fv1_2frow_2eproto::offsets[] PROTOBUF_SECTI
::_pbi::kInvalidFieldOffsetTag,
::_pbi::kInvalidFieldOffsetTag,
::_pbi::kInvalidFieldOffsetTag,
::_pbi::kInvalidFieldOffsetTag,
::_pbi::kInvalidFieldOffsetTag,
::_pbi::kInvalidFieldOffsetTag,
::_pbi::kInvalidFieldOffsetTag,
PROTOBUF_FIELD_OFFSET(::greptime::v1::Value, _impl_.value_data_),
};
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
@@ -166,7 +170,7 @@ const char descriptor_table_protodef_greptime_2fv1_2frow_2eproto[] PROTOBUF_SECT
"\0162\033.greptime.v1.ColumnDataType\0220\n\rsemant"
"ic_type\030\003 \001(\0162\031.greptime.v1.SemanticType"
"\")\n\003Row\022\"\n\006values\030\001 \003(\0132\022.greptime.v1.Va"
"lue\"\212\006\n\005Value\022\022\n\010i8_value\030\001 \001(\005H\000\022\023\n\ti16"
"lue\"\234\007\n\005Value\022\022\n\010i8_value\030\001 \001(\005H\000\022\023\n\ti16"
"_value\030\002 \001(\005H\000\022\023\n\ti32_value\030\003 \001(\005H\000\022\023\n\ti"
"64_value\030\004 \001(\003H\000\022\022\n\010u8_value\030\005 \001(\rH\000\022\023\n\t"
"u16_value\030\006 \001(\rH\000\022\023\n\tu32_value\030\007 \001(\rH\000\022\023"
@@ -185,16 +189,20 @@ const char descriptor_table_protodef_greptime_2fv1_2frow_2eproto[] PROTOBUF_SECT
"th_values\030\030 \001(\005H\000\022\"\n\030interval_day_time_v"
"alues\030\031 \001(\003H\000\022K\n\036interval_month_day_nano"
"_values\030\032 \001(\0132!.greptime.v1.IntervalMont"
"hDayNanoH\000B\014\n\nvalue_dataBP\n\016io.greptime."
"v1B\007RowDataZ5github.com/GreptimeTeam/gre"
"ptime-proto/go/greptime/v1b\006proto3"
"hDayNanoH\000\022\037\n\025duration_second_value\030\033 \001("
"\003H\000\022$\n\032duration_millisecond_value\030\034 \001(\003H"
"\000\022$\n\032duration_microsecond_value\030\035 \001(\003H\000\022"
"#\n\031duration_nanosecond_value\030\036 \001(\003H\000B\014\n\n"
"value_dataBP\n\016io.greptime.v1B\007RowDataZ5g"
"ithub.com/GreptimeTeam/greptime-proto/go"
"/greptime/v1b\006proto3"
;
static const ::_pbi::DescriptorTable* const descriptor_table_greptime_2fv1_2frow_2eproto_deps[1] = {
&::descriptor_table_greptime_2fv1_2fcommon_2eproto,
};
static ::_pbi::once_flag descriptor_table_greptime_2fv1_2frow_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_greptime_2fv1_2frow_2eproto = {
false, false, 1194, descriptor_table_protodef_greptime_2fv1_2frow_2eproto,
false, false, 1340, descriptor_table_protodef_greptime_2fv1_2frow_2eproto,
"greptime/v1/row.proto",
&descriptor_table_greptime_2fv1_2frow_2eproto_once, descriptor_table_greptime_2fv1_2frow_2eproto_deps, 1, 4,
schemas, file_default_instances, TableStruct_greptime_2fv1_2frow_2eproto::offsets,
@@ -1040,6 +1048,22 @@ Value::Value(const Value& from)
from._internal_interval_month_day_nano_values());
break;
}
case kDurationSecondValue: {
_this->_internal_set_duration_second_value(from._internal_duration_second_value());
break;
}
case kDurationMillisecondValue: {
_this->_internal_set_duration_millisecond_value(from._internal_duration_millisecond_value());
break;
}
case kDurationMicrosecondValue: {
_this->_internal_set_duration_microsecond_value(from._internal_duration_microsecond_value());
break;
}
case kDurationNanosecondValue: {
_this->_internal_set_duration_nanosecond_value(from._internal_duration_nanosecond_value());
break;
}
case VALUE_DATA_NOT_SET: {
break;
}
@@ -1188,6 +1212,22 @@ void Value::clear_value_data() {
}
break;
}
case kDurationSecondValue: {
// No need to clear
break;
}
case kDurationMillisecondValue: {
// No need to clear
break;
}
case kDurationMicrosecondValue: {
// No need to clear
break;
}
case kDurationNanosecondValue: {
// No need to clear
break;
}
case VALUE_DATA_NOT_SET: {
break;
}
@@ -1423,6 +1463,38 @@ const char* Value::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
} else
goto handle_unusual;
continue;
// int64 duration_second_value = 27;
case 27:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 216)) {
_internal_set_duration_second_value(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
CHK_(ptr);
} else
goto handle_unusual;
continue;
// int64 duration_millisecond_value = 28;
case 28:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 224)) {
_internal_set_duration_millisecond_value(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
CHK_(ptr);
} else
goto handle_unusual;
continue;
// int64 duration_microsecond_value = 29;
case 29:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 232)) {
_internal_set_duration_microsecond_value(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
CHK_(ptr);
} else
goto handle_unusual;
continue;
// int64 duration_nanosecond_value = 30;
case 30:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 240)) {
_internal_set_duration_nanosecond_value(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
CHK_(ptr);
} else
goto handle_unusual;
continue;
default:
goto handle_unusual;
} // switch
@@ -1613,6 +1685,30 @@ uint8_t* Value::_InternalSerialize(
_Internal::interval_month_day_nano_values(this).GetCachedSize(), target, stream);
}
// int64 duration_second_value = 27;
if (_internal_has_duration_second_value()) {
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteInt64ToArray(27, this->_internal_duration_second_value(), target);
}
// int64 duration_millisecond_value = 28;
if (_internal_has_duration_millisecond_value()) {
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteInt64ToArray(28, this->_internal_duration_millisecond_value(), target);
}
// int64 duration_microsecond_value = 29;
if (_internal_has_duration_microsecond_value()) {
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteInt64ToArray(29, this->_internal_duration_microsecond_value(), target);
}
// int64 duration_nanosecond_value = 30;
if (_internal_has_duration_nanosecond_value()) {
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteInt64ToArray(30, this->_internal_duration_nanosecond_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);
@@ -1786,6 +1882,34 @@ size_t Value::ByteSizeLong() const {
*_impl_.value_data_.interval_month_day_nano_values_);
break;
}
// int64 duration_second_value = 27;
case kDurationSecondValue: {
total_size += 2 +
::_pbi::WireFormatLite::Int64Size(
this->_internal_duration_second_value());
break;
}
// int64 duration_millisecond_value = 28;
case kDurationMillisecondValue: {
total_size += 2 +
::_pbi::WireFormatLite::Int64Size(
this->_internal_duration_millisecond_value());
break;
}
// int64 duration_microsecond_value = 29;
case kDurationMicrosecondValue: {
total_size += 2 +
::_pbi::WireFormatLite::Int64Size(
this->_internal_duration_microsecond_value());
break;
}
// int64 duration_nanosecond_value = 30;
case kDurationNanosecondValue: {
total_size += 2 +
::_pbi::WireFormatLite::Int64Size(
this->_internal_duration_nanosecond_value());
break;
}
case VALUE_DATA_NOT_SET: {
break;
}
@@ -1914,6 +2038,22 @@ void Value::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF
from._internal_interval_month_day_nano_values());
break;
}
case kDurationSecondValue: {
_this->_internal_set_duration_second_value(from._internal_duration_second_value());
break;
}
case kDurationMillisecondValue: {
_this->_internal_set_duration_millisecond_value(from._internal_duration_millisecond_value());
break;
}
case kDurationMicrosecondValue: {
_this->_internal_set_duration_microsecond_value(from._internal_duration_microsecond_value());
break;
}
case kDurationNanosecondValue: {
_this->_internal_set_duration_nanosecond_value(from._internal_duration_nanosecond_value());
break;
}
case VALUE_DATA_NOT_SET: {
break;
}