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

Improve from_json_to_raw_map #2562

Draft
wants to merge 31 commits into
base: branch-24.12
Choose a base branch
from

Conversation

ttnghia
Copy link
Collaborator

@ttnghia ttnghia commented Nov 1, 2024

This adds a couple of missing functionalities to from_json_to_raw_map, which is the backend of from_json with map<string, string> schema:

  • Support null/empty JSON strings.
  • Support single quotes.
  • Recovery from failure: invalid JSON strings will result in nulls for these specific rows while the rest can be parsed correctly.

Depends on:

Closes:

Signed-off-by: Nghia Truong <[email protected]>
Signed-off-by: Nghia Truong <[email protected]>
Signed-off-by: Nghia Truong <[email protected]>
Signed-off-by: Nghia Truong <[email protected]>
Signed-off-by: Nghia Truong <[email protected]>
Signed-off-by: Nghia Truong <[email protected]>
Signed-off-by: Nghia Truong <[email protected]>
Signed-off-by: Nghia Truong <[email protected]>
Signed-off-by: Nghia Truong <[email protected]>
Signed-off-by: Nghia Truong <[email protected]>
Signed-off-by: Nghia Truong <[email protected]>
Signed-off-by: Nghia Truong <[email protected]>
Signed-off-by: Nghia Truong <[email protected]>
@ttnghia ttnghia added bug Something isn't working enhancement New feature or request labels Nov 1, 2024
@ttnghia ttnghia self-assigned this Nov 1, 2024
Signed-off-by: Nghia Truong <[email protected]>
@ttnghia ttnghia requested a review from revans2 November 1, 2024 21:44
Signed-off-by: Nghia Truong <[email protected]>
revans2
revans2 previously approved these changes Nov 5, 2024
std::unique_ptr<cudf::column> const& extracted_keys,
std::unique_ptr<cudf::column> const& extracted_values,
rmm::cuda_stream_view stream)
{
auto const keys_child = extracted_keys->child(cudf::strings_column_view::chars_column_index);
if (extracted_keys->size() == 0) {
std::cerr << "Extract keys-values are all empty.\n" << std::endl;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we need to delete this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is debug code to help me figure out what's going on with the intermediate results. It will not be compiled into production.

# Conflicts:
#	src/main/cpp/src/json_utils.hpp
@ttnghia ttnghia marked this pull request as ready for review November 5, 2024 22:00
@ttnghia
Copy link
Collaborator Author

ttnghia commented Nov 5, 2024

build

@ttnghia
Copy link
Collaborator Author

ttnghia commented Nov 5, 2024

Need to add more integration tests to spark-rapids to verify before merging this.

Signed-off-by: Nghia Truong <[email protected]>
@ttnghia ttnghia marked this pull request as draft November 6, 2024 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
2 participants