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

Rename function and class containing from_json #2327

Merged
merged 8 commits into from
Aug 20, 2024

Conversation

ttnghia
Copy link
Collaborator

@ttnghia ttnghia commented Aug 14, 2024

This includes a few changes for from_json function:

  • Renames from_json into from_json_to_raw_map, since the current implementation is not a full-feature from_json.
  • Move the corresponding JNI C++ and Java function from MapUtils into JSONUtils, since JSON is more relevant than map.

Moving away from Map* into JSON* is necessary for further development of from_json to support more output data types other than just map.

To avoid breaking changes in the Spark plugin, the function MapUtils#extractRawMapFromJsonString is redirected to JSONUtils#extractRawMapFromJsonString. The entire class MapUtils will be removed in the follow up work.

Signed-off-by: Nghia Truong <nghiat@nvidia.com>
Signed-off-by: Nghia Truong <nghiat@nvidia.com>
Signed-off-by: Nghia Truong <nghiat@nvidia.com>
Signed-off-by: Nghia Truong <nghiat@nvidia.com>
Signed-off-by: Nghia Truong <nghiat@nvidia.com>
Signed-off-by: Nghia Truong <nghiat@nvidia.com>
@ttnghia
Copy link
Collaborator Author

ttnghia commented Aug 14, 2024

build

Copy link
Collaborator

@revans2 revans2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks fine. My main concern is that we are going to break the plugin. Could you please keep MapUtils.java with the extractRawMapFromJsonString but have it call into JSONUtils.java's extractRawMapFromJsonString? But because of how the plugin works we cannot deprecate the MapUtils API. But we can delete it as soon as the plugin is updated to use the new API.

@ttnghia
Copy link
Collaborator Author

ttnghia commented Aug 19, 2024

build

@ttnghia
Copy link
Collaborator Author

ttnghia commented Aug 19, 2024

Could you please keep MapUtils.java with the extractRawMapFromJsonString but have it call into JSONUtils.java's extractRawMapFromJsonString?

That sounds good. Now we have MapUtils#extractRawMapFromJsonString calls to JSONUtils#extractRawMapFromJsonString so we won't break the plugin build.

@ttnghia ttnghia requested a review from revans2 August 19, 2024 20:10
@ttnghia ttnghia merged commit c058c73 into NVIDIA:branch-24.10 Aug 20, 2024
3 checks passed
@ttnghia ttnghia deleted the move_from_json branch August 20, 2024 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants