From 8c097ebfe7c10585331c202066b16100caf18cd2 Mon Sep 17 00:00:00 2001 From: WenyXu Date: Tue, 29 Oct 2024 03:05:16 +0000 Subject: [PATCH] feat: add json datatype for grpc protocol --- src/api/src/helper.rs | 5 +++++ src/operator/src/req_convert/common.rs | 1 + 2 files changed, 6 insertions(+) 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), (