-
Notifications
You must be signed in to change notification settings - Fork 915
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
Introduce GetJsonObjectOptions
in getJSONObject
Java API
#14956
Introduce GetJsonObjectOptions
in getJSONObject
Java API
#14956
Conversation
GetJsonObjectOptions
to address Single Quotes issueGetJsonObjectOptions
in getJSONObject
Java API
GetJsonObjectOptions
in getJSONObject
Java APIGetJsonObjectOptions
in getJSONObject
Java API
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: Just curious about the design choices used here.
The Java public interface has aGetJsonObjectOptions
.
then JNI.cpp interface uses 3 booleans.
libcudf uses get_json_object_options
(constructed from these 3 booleans)
The data flows as (Java object) -> 3 booleans in function arguments -> (C++ object)
Is this a limitation of JNI?
Can we directly use (Java object) or (C++ object) in the function argument?
@karthikeyann it really is about JNI limitations. We have a few choices for what we could do. We could have a java class that creates an instance of a C++ object and holds a reference to it. Then anything that interacts with the object needs to call into JNI to change things. It also has the possibility of being leaked if the java code does not close it, or if we don't put in a We could have a pure java class that holds the values, and we could pass an instance of that class into JNI. But it is very slow to call back into java from JNI. So if we know that all of the values are going to be used, we typically just pull it apart in java and send them down as separate parameters so the performance is not too bad. |
Signed-off-by: Suraj Aralihalli <[email protected]>
Signed-off-by: Suraj Aralihalli <[email protected]>
/merge |
Description
Addresses 10219
This PR introduces a new class named
GetJsonObjectOptions
that holds the configurations to control the behavior of the underlyingcudf::get_json_object
function. It incorporates this new class into thegetJSONObject
JAVA API as an additional argument but also keeps the previous API to maintain backwards compatibility. It also includes a test case,testGetJSONObjectWithSingleQuotes
, validating the behavior ofgetJSONObject
when single quotes are enabled.Checklist