From 49f3852aadbb82875cc8bd2628a070235ae68be8 Mon Sep 17 00:00:00 2001 From: WenyXu Date: Tue, 29 Oct 2024 02:54:14 +0000 Subject: [PATCH 1/2] chore: update greptime-proto --- Cargo.lock | 4 ++++ Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 0c8114f7de12..1c86715aa0a1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4531,7 +4531,11 @@ dependencies = [ [[package]] name = "greptime-proto" version = "0.1.0" +<<<<<<< HEAD source = "git+https://github.com/GreptimeTeam/greptime-proto.git?rev=fc45ac4cce7e91c9438c2e5a497a4d99531397f1#fc45ac4cce7e91c9438c2e5a497a4d99531397f1" +======= +source = "git+https://github.com/GreptimeTeam/greptime-proto.git?rev=c82e94411ecc110744606855923852e4446ba461#c82e94411ecc110744606855923852e4446ba461" +>>>>>>> e8ca43e50f (chore: update greptime-proto) dependencies = [ "prost 0.12.6", "serde", diff --git a/Cargo.toml b/Cargo.toml index 48bf291f629c..6795e8927f76 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -121,7 +121,7 @@ etcd-client = { version = "0.13" } fst = "0.4.7" futures = "0.3" futures-util = "0.3" -greptime-proto = { git = "https://github.com/GreptimeTeam/greptime-proto.git", rev = "fc45ac4cce7e91c9438c2e5a497a4d99531397f1" } +greptime-proto = { git = "https://github.com/GreptimeTeam/greptime-proto.git", rev = "9faf45e8bd83cba106ddfb09bba85784bf9ade2a" } humantime = "2.1" humantime-serde = "1.1" itertools = "0.10" From e73b40947cddfba729c16ef7689201c9d156c356 Mon Sep 17 00:00:00 2001 From: WenyXu Date: Tue, 29 Oct 2024 03:05:16 +0000 Subject: [PATCH 2/2] feat: add json datatype for grpc protocol --- Cargo.lock | 6 +----- src/api/src/helper.rs | 5 +++++ src/operator/src/req_convert/common.rs | 1 + 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1c86715aa0a1..40b5948bcc7d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4531,11 +4531,7 @@ dependencies = [ [[package]] name = "greptime-proto" version = "0.1.0" -<<<<<<< HEAD -source = "git+https://github.com/GreptimeTeam/greptime-proto.git?rev=fc45ac4cce7e91c9438c2e5a497a4d99531397f1#fc45ac4cce7e91c9438c2e5a497a4d99531397f1" -======= -source = "git+https://github.com/GreptimeTeam/greptime-proto.git?rev=c82e94411ecc110744606855923852e4446ba461#c82e94411ecc110744606855923852e4446ba461" ->>>>>>> e8ca43e50f (chore: update greptime-proto) +source = "git+https://github.com/GreptimeTeam/greptime-proto.git?rev=9faf45e8bd83cba106ddfb09bba85784bf9ade2a#9faf45e8bd83cba106ddfb09bba85784bf9ade2a" dependencies = [ "prost 0.12.6", "serde", diff --git a/src/api/src/helper.rs b/src/api/src/helper.rs index 4281201c4293..9d8bbacff99c 100644 --- a/src/api/src/helper.rs +++ b/src/api/src/helper.rs @@ -116,6 +116,7 @@ impl From for ConcreteDataType { ConcreteDataType::binary_datatype() } } + ColumnDataType::Json => ConcreteDataType::json_datatype(), ColumnDataType::String => ConcreteDataType::string_datatype(), ColumnDataType::Date => ConcreteDataType::date_datatype(), ColumnDataType::Datetime => ConcreteDataType::datetime_datatype(), @@ -417,6 +418,10 @@ pub fn values_with_capacity(datatype: ColumnDataType, capacity: usize) -> Values decimal128_values: Vec::with_capacity(capacity), ..Default::default() }, + ColumnDataType::Json => Values { + string_values: Vec::with_capacity(capacity), + ..Default::default() + }, } } diff --git a/src/operator/src/req_convert/common.rs b/src/operator/src/req_convert/common.rs index 3994b32fc7f7..355a908d2a5a 100644 --- a/src/operator/src/req_convert/common.rs +++ b/src/operator/src/req_convert/common.rs @@ -114,6 +114,7 @@ fn push_column_to_rows(column: Column, rows: &mut [Row]) -> Result<()> { (Float64, F64Value, f64_values), (Binary, BinaryValue, binary_values), (String, StringValue, string_values), + (Json, StringValue, string_values), (Date, DateValue, date_values), (Datetime, DatetimeValue, datetime_values), (