Skip to content

[Bug] JsonbPath::seek CANNOT correctly analyze seek's json path #50150

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
2 of 3 tasks
ChenMiaoi opened this issue Apr 17, 2025 · 0 comments
Open
2 of 3 tasks

[Bug] JsonbPath::seek CANNOT correctly analyze seek's json path #50150

ChenMiaoi opened this issue Apr 17, 2025 · 0 comments

Comments

@ChenMiaoi
Copy link
Contributor

Search before asking

  • I had searched in the issues and found no similar issues.

Version

Commit: 12e774bfd2

What's Wrong?

While I was supporting extra arguments for the json_search function, I wrote the following unit test:

{{STRING(R"({"k1":"v1", "k2": "v2"})"), STRING("one"), STRING("v1"), STRING("\\"),
              STRING("$.not_exist")},
             Null()},

the start_path specificed by $.not_exist. If the JsonbPath::seek function is correct, then the unit test throws an exception, but it does not. I found through debugging that it does not return false in this logic:

std::string root_path_str = "$";
if (!start_null_check(i)) {
    root_path_str = get_start_string(i);
}
JsonbPath root_path;
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);
}

In the above code, root_path.seek should return false.

What You Expected?

I think it may be that seek's implementation or third-party libraries are not yet supported, and we need manual support.

How to Reproduce?

No response

Anything Else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant