Skip to content
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

[BUG] GetJsonObject throws exception when json path contains a name starting with ' #10537

Closed
thirtiseven opened this issue Mar 4, 2024 · 2 comments · Fixed by #10581
Closed
Assignees
Labels
bug Something isn't working

Comments

@thirtiseven
Copy link
Collaborator

thirtiseven commented Mar 4, 2024

Describe the bug
$.'a is a valid path from Spark's check, so it is normalized to $[''a'] and passed to kernel in plugin, resulting in

ai.rapids.cudf.CudfException: CUDF failure on: /home/jenkins/agent/workspace/jenkins-spark-rapids-jni_nightly-dev-690-cuda11/thirdparty/cudf/cpp/src/json/json_path.cu:631: Invalid empty name in JSONPath query string

Note that $[''a'] is actually an invalid path from Spark's validation. So maybe the normalization we did in plugin b9c292c is losing some information when converting the List[PathInstruction] back to a string and causing some problems.

And at the same time, cuDF kernel can't match this case as well if we remove the normalization.

data: {"'a":"1"}

Spark, spark-rapids, cudf and jsonpath.com will give very different results in this case.

JSONPath Spark spark-rapids cudf kernel(spark-rapids without normalization) jsonpath.com
$[''a'] null null Invalid empty name in JSONPath query string ["1"]
$.'a 1 Invalid empty name in JSONPath query string Encountered invalid JSONPath input string No match

I think we can fallback on this case until we have a path parser that matches Spark's behavior.

@thirtiseven
Copy link
Collaborator Author

rapidsai/cudf#15082 looks to be contributing to fixing this issue, will update after it is included in the plugin.

@sameerz sameerz removed the ? - Needs Triage Need team to review and classify label Mar 5, 2024
@res-life
Copy link
Collaborator

Will be fixed by: NVIDIA/spark-rapids-jni#1868

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants