yangzhg commented on a change in pull request #6504: URL: https://github.com/apache/incubator-doris/pull/6504#discussion_r699981146
########## File path: be/src/exprs/json_functions.cpp ########## @@ -108,6 +109,96 @@ DoubleVal JsonFunctions::get_json_double(FunctionContext* context, const StringV } } +StringVal JsonFunctions::json_array(FunctionContext* context, int num_args, + const StringVal* json_str) { + if (json_str->is_null) { + return StringVal::null(); + } + rapidjson::Value array_obj(rapidjson::kArrayType); + rapidjson::Document document; + rapidjson::Document::AllocatorType& allocator = document.GetAllocator(); + //flag: The number it contains represents the type of previous parameters + StringVal flag(json_str[num_args - 1].ptr, json_str[num_args - 1].len); + DCHECK_EQ(num_args - 1, flag.len); + for (int i = 0; i < num_args - 1; ++i) { + StringVal arg(json_str[i].ptr, json_str[i].len); + rapidjson::Value val = parse_str_with_flag(arg, flag, i, allocator); Review comment: ```suggestion rapidjson::Value val = parse_str_with_flag(arg, *flag, i, allocator); ``` -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org