ChenMiaoi commented on code in PR #50151:
URL: https://github.com/apache/doris/pull/50151#discussion_r2055733521


##########
be/src/vec/functions/function_jsonb.cpp:
##########
@@ -1758,16 +1834,31 @@ class FunctionJsonSearch : public IFunction {
             }
 
             // an error occurs if any path argument is not a valid path 
expression.
+            // root_path_str = get_start_string(i);
             std::string root_path_str = "$";
+            if (!start_null_check(i)) {
+                root_path_str = get_start_string(i);
+            }
             JsonbPath root_path;
-            root_path.seek(root_path_str.c_str(), root_path_str.size());
+            if (!root_path.seek(root_path_str.c_str(), root_path_str.size())) {
+                return Status::InvalidArgument(
+                        "the start_path argument {} is not a valid json path", 
root_path_str);
+            }
             std::vector<JsonbPath*> paths;
             paths.push_back(&root_path);
 
             if (!search_is_const) {
                 state_ptr = std::make_shared<LikeState>();
                 state_ptr->is_like_pattern = true;
                 const auto& search_str = col_search_string->get_data_at(i);
+
+                // The default is \ if the escape_char argument is missing or 
NULL.

Review Comment:
   done it, but I meet a problem need help



-- 
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]

Reply via email to