You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2021/09/01 02:38:05 UTC

[GitHub] [incubator-doris] yangzhg commented on a change in pull request #6504: [Feature]support three functions of json

yangzhg commented on a change in pull request #6504:
URL: https://github.com/apache/incubator-doris/pull/6504#discussion_r699800543



##########
File path: be/src/exprs/json_functions.cpp
##########
@@ -108,6 +108,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
+    std::string flag((char*)json_str[num_args - 1].ptr, json_str[num_args - 1].len);
+    DCHECK(num_args-1==flag.length());

Review comment:
       ```suggestion
       DCHECK_EQ(num_args - 1, flag.length());
   ```




-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org