fix:big json text do parser construct tree too slow

This commit is contained in:
obdev
2023-06-16 03:12:19 +00:00
committed by ob-robot
parent 9ce10fcef5
commit a6367c9813
8 changed files with 151 additions and 22 deletions

View File

@ -6626,7 +6626,7 @@ int ObAggregateProcessor::get_json_objectagg_result(const ObAggrInfo &aggr_info,
}
if (OB_FAIL(ret)) {
} else if (OB_FAIL(json_object.object_add(key_data, json_val))) {
} else if (OB_FAIL(json_object.add(key_data, static_cast<ObJsonNode*>(json_val), false, true, false))) {
LOG_WARN("failed: json object add json value", K(ret));
} else if (json_object.get_serialize_size() > OB_MAX_PACKET_LENGTH) {
ret = OB_ERR_TOO_LONG_STRING_IN_CONCAT;
@ -6645,6 +6645,8 @@ int ObAggregateProcessor::get_json_objectagg_result(const ObAggrInfo &aggr_info,
} else {
ret = OB_SUCCESS;
ObString str;
json_object.stable_sort();
json_object.unique();
// output res
if (OB_FAIL(json_object.get_raw_binary(str, &aggr_alloc_))) {
LOG_WARN("get result binary failed", K(ret));