From 86ed051dfde8735277b2ba8e01c7ea46848ef00f Mon Sep 17 00:00:00 2001 From: Weny Xu Date: Wed, 30 Oct 2024 04:12:24 +0800 Subject: [PATCH] chore: add json type (#194) --- c++/greptime/v1/common.pb.cc | 14 ++++++----- c++/greptime/v1/common.pb.h | 3 ++- go/greptime/v1/common.pb.go | 23 +++++++++++-------- java/src/main/java/io/greptime/v1/Common.java | 20 ++++++++++++---- proto/greptime/v1/common.proto | 1 + 5 files changed, 39 insertions(+), 22 deletions(-) diff --git a/c++/greptime/v1/common.pb.cc b/c++/greptime/v1/common.pb.cc index 3dcbcd9a..f3b74907 100644 --- a/c++/greptime/v1/common.pb.cc +++ b/c++/greptime/v1/common.pb.cc @@ -561,7 +561,7 @@ const char descriptor_table_protodef_greptime_2fv1_2fcommon_2eproto[] PROTOBUF_S "Options.OptionsEntry\032.\n\014OptionsEntry\022\013\n\003" "key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001*1\n\014Semantic" "Type\022\007\n\003TAG\020\000\022\t\n\005FIELD\020\001\022\r\n\tTIMESTAMP\020\002*" - "\326\003\n\016ColumnDataType\022\013\n\007BOOLEAN\020\000\022\010\n\004INT8\020" + "\340\003\n\016ColumnDataType\022\013\n\007BOOLEAN\020\000\022\010\n\004INT8\020" "\001\022\t\n\005INT16\020\002\022\t\n\005INT32\020\003\022\t\n\005INT64\020\004\022\t\n\005UI" "NT8\020\005\022\n\n\006UINT16\020\006\022\n\n\006UINT32\020\007\022\n\n\006UINT64\020" "\010\022\013\n\007FLOAT32\020\t\022\013\n\007FLOAT64\020\n\022\n\n\006BINARY\020\013\022" @@ -572,14 +572,15 @@ const char descriptor_table_protodef_greptime_2fv1_2fcommon_2eproto[] PROTOBUF_S "ME_MILLISECOND\020\024\022\024\n\020TIME_MICROSECOND\020\025\022\023" "\n\017TIME_NANOSECOND\020\026\022\027\n\023INTERVAL_YEAR_MON" "TH\020\027\022\025\n\021INTERVAL_DAY_TIME\020\030\022\033\n\027INTERVAL_" - "MONTH_DAY_NANO\020\031\022\016\n\nDECIMAL128\020\036*$\n\021Json" - "TypeExtension\022\017\n\013JSON_BINARY\020\000BO\n\016io.gre" - "ptime.v1B\006CommonZ5github.com/GreptimeTea" - "m/greptime-proto/go/greptime/v1b\006proto3" + "MONTH_DAY_NANO\020\031\022\016\n\nDECIMAL128\020\036\022\010\n\004JSON" + "\020\037*$\n\021JsonTypeExtension\022\017\n\013JSON_BINARY\020\000" + "BO\n\016io.greptime.v1B\006CommonZ5github.com/G" + "reptimeTeam/greptime-proto/go/greptime/v" + "1b\006proto3" ; static ::_pbi::once_flag descriptor_table_greptime_2fv1_2fcommon_2eproto_once; const ::_pbi::DescriptorTable descriptor_table_greptime_2fv1_2fcommon_2eproto = { - false, false, 2159, descriptor_table_protodef_greptime_2fv1_2fcommon_2eproto, + false, false, 2169, descriptor_table_protodef_greptime_2fv1_2fcommon_2eproto, "greptime/v1/common.proto", &descriptor_table_greptime_2fv1_2fcommon_2eproto_once, nullptr, 0, 20, schemas, file_default_instances, TableStruct_greptime_2fv1_2fcommon_2eproto::offsets, @@ -642,6 +643,7 @@ bool ColumnDataType_IsValid(int value) { case 24: case 25: case 30: + case 31: return true; default: return false; diff --git a/c++/greptime/v1/common.pb.h b/c++/greptime/v1/common.pb.h index f54d13f5..11676054 100644 --- a/c++/greptime/v1/common.pb.h +++ b/c++/greptime/v1/common.pb.h @@ -191,12 +191,13 @@ enum ColumnDataType : int { INTERVAL_DAY_TIME = 24, INTERVAL_MONTH_DAY_NANO = 25, DECIMAL128 = 30, + JSON = 31, ColumnDataType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), ColumnDataType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; bool ColumnDataType_IsValid(int value); constexpr ColumnDataType ColumnDataType_MIN = BOOLEAN; -constexpr ColumnDataType ColumnDataType_MAX = DECIMAL128; +constexpr ColumnDataType ColumnDataType_MAX = JSON; constexpr int ColumnDataType_ARRAYSIZE = ColumnDataType_MAX + 1; const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ColumnDataType_descriptor(); diff --git a/go/greptime/v1/common.pb.go b/go/greptime/v1/common.pb.go index 269610ea..a487279a 100644 --- a/go/greptime/v1/common.pb.go +++ b/go/greptime/v1/common.pb.go @@ -113,6 +113,7 @@ const ( ColumnDataType_INTERVAL_DAY_TIME ColumnDataType = 24 ColumnDataType_INTERVAL_MONTH_DAY_NANO ColumnDataType = 25 ColumnDataType_DECIMAL128 ColumnDataType = 30 + ColumnDataType_JSON ColumnDataType = 31 ) // Enum value maps for ColumnDataType. @@ -145,6 +146,7 @@ var ( 24: "INTERVAL_DAY_TIME", 25: "INTERVAL_MONTH_DAY_NANO", 30: "DECIMAL128", + 31: "JSON", } ColumnDataType_value = map[string]int32{ "BOOLEAN": 0, @@ -174,6 +176,7 @@ var ( "INTERVAL_DAY_TIME": 24, "INTERVAL_MONTH_DAY_NANO": 25, "DECIMAL128": 30, + "JSON": 31, } ) @@ -1415,7 +1418,7 @@ var file_greptime_v1_common_proto_rawDesc = []byte{ 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x2a, 0x31, 0x0a, 0x0c, 0x53, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x54, 0x79, 0x70, 0x65, 0x12, 0x07, 0x0a, 0x03, 0x54, 0x41, 0x47, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x49, - 0x4d, 0x45, 0x53, 0x54, 0x41, 0x4d, 0x50, 0x10, 0x02, 0x2a, 0xd6, 0x03, 0x0a, 0x0e, 0x43, 0x6f, + 0x4d, 0x45, 0x53, 0x54, 0x41, 0x4d, 0x50, 0x10, 0x02, 0x2a, 0xe0, 0x03, 0x0a, 0x0e, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x42, 0x4f, 0x4f, 0x4c, 0x45, 0x41, 0x4e, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x4e, 0x54, 0x38, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x49, 0x4e, 0x54, 0x31, 0x36, 0x10, 0x02, 0x12, 0x09, @@ -1445,15 +1448,15 @@ var file_greptime_v1_common_proto_rawDesc = []byte{ 0x49, 0x4d, 0x45, 0x10, 0x18, 0x12, 0x1b, 0x0a, 0x17, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x56, 0x41, 0x4c, 0x5f, 0x4d, 0x4f, 0x4e, 0x54, 0x48, 0x5f, 0x44, 0x41, 0x59, 0x5f, 0x4e, 0x41, 0x4e, 0x4f, 0x10, 0x19, 0x12, 0x0e, 0x0a, 0x0a, 0x44, 0x45, 0x43, 0x49, 0x4d, 0x41, 0x4c, 0x31, 0x32, 0x38, - 0x10, 0x1e, 0x2a, 0x24, 0x0a, 0x11, 0x4a, 0x73, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x45, 0x78, - 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0f, 0x0a, 0x0b, 0x4a, 0x53, 0x4f, 0x4e, 0x5f, - 0x42, 0x49, 0x4e, 0x41, 0x52, 0x59, 0x10, 0x00, 0x42, 0x4f, 0x0a, 0x0e, 0x69, 0x6f, 0x2e, 0x67, - 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x06, 0x43, 0x6f, 0x6d, 0x6d, - 0x6f, 0x6e, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x47, - 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x2f, 0x67, 0x72, 0x65, 0x70, - 0x74, 0x69, 0x6d, 0x65, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x67, 0x72, - 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x10, 0x1e, 0x12, 0x08, 0x0a, 0x04, 0x4a, 0x53, 0x4f, 0x4e, 0x10, 0x1f, 0x2a, 0x24, 0x0a, 0x11, + 0x4a, 0x73, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, + 0x6e, 0x12, 0x0f, 0x0a, 0x0b, 0x4a, 0x53, 0x4f, 0x4e, 0x5f, 0x42, 0x49, 0x4e, 0x41, 0x52, 0x59, + 0x10, 0x00, 0x42, 0x4f, 0x0a, 0x0e, 0x69, 0x6f, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, + 0x65, 0x2e, 0x76, 0x31, 0x42, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5a, 0x35, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x47, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, + 0x65, 0x54, 0x65, 0x61, 0x6d, 0x2f, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2d, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, + 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/java/src/main/java/io/greptime/v1/Common.java b/java/src/main/java/io/greptime/v1/Common.java index d71febb3..ee44c842 100644 --- a/java/src/main/java/io/greptime/v1/Common.java +++ b/java/src/main/java/io/greptime/v1/Common.java @@ -244,6 +244,10 @@ public enum ColumnDataType * DECIMAL128 = 30; */ DECIMAL128(30), + /** + * JSON = 31; + */ + JSON(31), UNRECOGNIZED(-1), ; @@ -355,6 +359,10 @@ public enum ColumnDataType * DECIMAL128 = 30; */ public static final int DECIMAL128_VALUE = 30; + /** + * JSON = 31; + */ + public static final int JSON_VALUE = 31; public final int getNumber() { @@ -408,6 +416,7 @@ public static ColumnDataType forNumber(int value) { case 24: return INTERVAL_DAY_TIME; case 25: return INTERVAL_MONTH_DAY_NANO; case 30: return DECIMAL128; + case 31: return JSON; default: return null; } } @@ -14231,7 +14240,7 @@ public io.greptime.v1.Common.ColumnOptions getDefaultInstanceForType() { "Options.OptionsEntry\032.\n\014OptionsEntry\022\013\n\003" + "key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001*1\n\014Semantic" + "Type\022\007\n\003TAG\020\000\022\t\n\005FIELD\020\001\022\r\n\tTIMESTAMP\020\002*" + - "\326\003\n\016ColumnDataType\022\013\n\007BOOLEAN\020\000\022\010\n\004INT8\020" + + "\340\003\n\016ColumnDataType\022\013\n\007BOOLEAN\020\000\022\010\n\004INT8\020" + "\001\022\t\n\005INT16\020\002\022\t\n\005INT32\020\003\022\t\n\005INT64\020\004\022\t\n\005UI" + "NT8\020\005\022\n\n\006UINT16\020\006\022\n\n\006UINT32\020\007\022\n\n\006UINT64\020" + "\010\022\013\n\007FLOAT32\020\t\022\013\n\007FLOAT64\020\n\022\n\n\006BINARY\020\013\022" + @@ -14242,10 +14251,11 @@ public io.greptime.v1.Common.ColumnOptions getDefaultInstanceForType() { "ME_MILLISECOND\020\024\022\024\n\020TIME_MICROSECOND\020\025\022\023" + "\n\017TIME_NANOSECOND\020\026\022\027\n\023INTERVAL_YEAR_MON" + "TH\020\027\022\025\n\021INTERVAL_DAY_TIME\020\030\022\033\n\027INTERVAL_" + - "MONTH_DAY_NANO\020\031\022\016\n\nDECIMAL128\020\036*$\n\021Json" + - "TypeExtension\022\017\n\013JSON_BINARY\020\000BO\n\016io.gre" + - "ptime.v1B\006CommonZ5github.com/GreptimeTea" + - "m/greptime-proto/go/greptime/v1b\006proto3" + "MONTH_DAY_NANO\020\031\022\016\n\nDECIMAL128\020\036\022\010\n\004JSON" + + "\020\037*$\n\021JsonTypeExtension\022\017\n\013JSON_BINARY\020\000" + + "BO\n\016io.greptime.v1B\006CommonZ5github.com/G" + + "reptimeTeam/greptime-proto/go/greptime/v" + + "1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, diff --git a/proto/greptime/v1/common.proto b/proto/greptime/v1/common.proto index 5124f41f..ce068840 100644 --- a/proto/greptime/v1/common.proto +++ b/proto/greptime/v1/common.proto @@ -117,6 +117,7 @@ enum ColumnDataType { INTERVAL_DAY_TIME = 24; INTERVAL_MONTH_DAY_NANO = 25; DECIMAL128 = 30; + JSON = 31; } message IntervalMonthDayNano {