yiguolei commented on code in PR #53843:
URL: https://github.com/apache/doris/pull/53843#discussion_r2246663744
##########
be/src/vec/data_types/serde/data_type_struct_serde.cpp:
##########
@@ -354,6 +354,40 @@ Status
DataTypeStructSerDe::serialize_column_to_jsonb(const IColumn& from_column
return Status::OK();
}
+Status DataTypeStructSerDe::deserialize_column_from_jsonb(IColumn& column,
+ const JsonbValue*
jsonb_value,
+ CastParameters&
castParms) const {
+ if (jsonb_value->isString()) {
+ RETURN_IF_ERROR(parse_column_from_jsonb_string(column, jsonb_value,
castParms));
+ return Status::OK();
+ }
+ auto& struct_column = assert_cast<ColumnStruct&>(column);
+ if (!jsonb_value->isObject()) {
+ return Status::InvalidArgument("jsonb_value is not an object");
+ }
+ const auto* jsonb_object = jsonb_value->unpack<ObjectVal>();
+
+ if (jsonb_object->numElem() != elem_names.size()) {
+ return Status::InvalidArgument("jsonb_value field size {} is not equal
to struct size {}",
+ jsonb_object->numElem(),
struct_column.tuple_size());
+ }
+
+ for (const auto& field_name : elem_names) {
+ if (!jsonb_object->find(field_name.data(), (int)field_name.size())) {
Review Comment:
@Mryange 这里得补充一个不区分大小写的beut
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]