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

Fix get_json_object producing wrong output with wildcard paths #2220

Merged
merged 5 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/main/cpp/src/get_json_object.cu
Original file line number Diff line number Diff line change
Expand Up @@ -488,10 +488,9 @@ __device__ bool evaluate_path(json_parser& p,
return false;
}
}
ctx.task_is_done = true;
} else {
return false;
}
// Mark task is done regardless whether the expected child was found.
ctx.task_is_done = true;
} else {
// below is 1st enter
ctx.is_first_enter = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -442,13 +442,14 @@ void getJsonObjectTest_Test_case_path7() {
};

String JSON1 = "[ {'k': [0, 1, 2]}, {'k': [10, 11, 12]}, {'k': [20, 21, 22]} ]";
String JSON2 = "[ {'k': [0, 1, 2]}, {'k': {'a': 'b'}}, {'k': [10, 11, 12]}, {'k': 'abc'} ]";
String expectedStr1 = "[[0,1,2],[10,11,12],[20,21,22]]";
String expectedStr2 = "[[0,1,2],[10,11,12]]";

try (
ColumnVector jsonCv = ColumnVector.fromStrings(JSON1);
ColumnVector expected = ColumnVector.fromStrings(expectedStr1);
ColumnVector jsonCv = ColumnVector.fromStrings(JSON1, JSON2);
ColumnVector expected = ColumnVector.fromStrings(expectedStr1, expectedStr2);
ColumnVector actual = JSONUtils.getJsonObject(jsonCv, query)) {

assertColumnsAreEqual(expected, actual);
}
}
Expand Down
Loading