mapleFU commented on code in PR #1847:
URL: https://github.com/apache/kvrocks/pull/1847#discussion_r1367738708
##########
src/types/json.h:
##########
@@ -132,6 +132,44 @@ struct JsonValue {
return Status::OK();
}
+ Status Type(std::string_view path, std::vector<std::string> *types) const {
+ types->clear();
+ try {
+ jsoncons::jsonpath::json_query(value, path, [&types](const std::string &
/*path*/, const jsoncons::json &val) {
+ switch (val.type()) {
+ case jsoncons::json_type::null_value:
+ types->emplace_back("null");
+ break;
+ case jsoncons::json_type::bool_value:
+ types->emplace_back("boolean");
+ break;
+ case jsoncons::json_type::int64_value:
+ case jsoncons::json_type::uint64_value:
+ types->emplace_back("integer");
+ break;
+ case jsoncons::json_type::double_value:
+ types->emplace_back("number");
Review Comment:
Should we support `half` here?
##########
src/types/json.h:
##########
@@ -132,6 +132,44 @@ struct JsonValue {
return Status::OK();
}
+ Status Type(std::string_view path, std::vector<std::string> *types) const {
+ types->clear();
+ try {
+ jsoncons::jsonpath::json_query(value, path, [&types](const std::string &
/*path*/, const jsoncons::json &val) {
+ switch (val.type()) {
+ case jsoncons::json_type::null_value:
+ types->emplace_back("null");
+ break;
+ case jsoncons::json_type::bool_value:
+ types->emplace_back("boolean");
+ break;
+ case jsoncons::json_type::int64_value:
+ case jsoncons::json_type::uint64_value:
+ types->emplace_back("integer");
+ break;
+ case jsoncons::json_type::double_value:
+ types->emplace_back("number");
+ break;
+ case jsoncons::json_type::string_value:
Review Comment:
So binary is not supported?
--
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]