PragmaTwice commented on code in PR #1829:
URL: https://github.com/apache/kvrocks/pull/1829#discussion_r1364826065


##########
src/types/redis_json.cc:
##########
@@ -102,14 +108,18 @@ rocksdb::Status Json::Get(const std::string &user_key, 
const std::vector<std::st
   if (paths.empty()) {
     res = std::move(json_val);
   } else if (paths.size() == 1) {
-    auto get_res = json_val.Get(paths[0]);
+    auto json_path_result = JsonPath::BuildJsonPath(paths[0]);
+    if (!json_path_result) return 
rocksdb::Status::InvalidArgument(json_path_result.Msg());
+    auto get_res = json_val.Get(json_path_result.GetValue());
     if (!get_res) return rocksdb::Status::InvalidArgument(get_res.Msg());
     res = *std::move(get_res);
   } else {
     for (const auto &path : paths) {
-      auto get_res = json_val.Get(path);
+      auto json_path_result = JsonPath::BuildJsonPath(path);
+      if (!json_path_result) return 
rocksdb::Status::InvalidArgument(json_path_result.Msg());
+      auto get_res = json_val.Get(json_path_result.GetValue());
       if (!get_res) return rocksdb::Status::InvalidArgument(get_res.Msg());

Review Comment:
   I don't think maybe there's difference between the original code and this 
patch here.



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

Reply via email to