gitccl commented on code in PR #19185: URL: https://github.com/apache/doris/pull/19185#discussion_r1180932453
########## be/src/util/jsonb_document.h: ########## @@ -1099,16 +1099,38 @@ inline JsonbValue* JsonbValue::findPath(const char* key_path, unsigned int kp_le unsigned int klen = 0; const char* left_bracket = nullptr; const char* right_bracket = nullptr; + const char* left_quotation_marks = nullptr; + const char* right_quotation_marks = nullptr; size_t idx_len = 0; + bool key_has_delim = false; // find the current key and [] bracket position - for (; key_path != fence && *key_path != *delim; ++key_path, ++klen) { + for (; key_path != fence; ++key_path, ++klen) { if ('[' == *key_path) { left_bracket = key_path; } else if (']' == *key_path) { right_bracket = key_path; + } else if ('"' == *key_path) { + if (left_quotation_marks == nullptr) { + left_quotation_marks = key_path; + } else { + right_quotation_marks = key_path; + } + } else if (*key_path == *delim) { + if (left_quotation_marks == nullptr || right_quotation_marks != nullptr) { + break; + } else if (left_quotation_marks != nullptr) { + if (!key_has_delim) { + key_has_delim = true; + } + } } } + if (key_has_delim) { + key++; + klen = klen - 2; + } Review Comment: Maybe we can judge `if (left_quotation_marks != nullptr && right_quotation_marks != nullptr)` to support case `$."a"`? -- 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