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

Enforce schema for partial tables in multi-source multi-batch JSON reader #17708

Open
wants to merge 17 commits into
base: branch-25.02
Choose a base branch
from

Conversation

shrshi
Copy link
Contributor

@shrshi shrshi commented Jan 9, 2025

Description

Closes #17689

This PR resolves a bug in the multi-batch JSON reader, wherein the reader was throwing an error when the column schema for any two partial tables from different batches did not match. We now enforce the column ordering in the first partial table i.e. the table returned by the first batch in all succeeding batches.
The test added passes three string as three separate batches to the reader by setting the batch size to that of the first string.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

Copy link

copy-pr-bot bot commented Jan 9, 2025

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@github-actions github-actions bot added the libcudf Affects libcudf (C++/CUDA) code. label Jan 9, 2025
@shrshi shrshi added bug Something isn't working cuIO cuIO issue non-breaking Non-breaking change labels Jan 9, 2025
@shrshi
Copy link
Contributor Author

shrshi commented Jan 9, 2025

/ok to test

@shrshi
Copy link
Contributor Author

shrshi commented Jan 10, 2025

/ok to test

@shrshi shrshi marked this pull request as ready for review January 10, 2025 02:53
@shrshi shrshi requested a review from a team as a code owner January 10, 2025 02:53
@shrshi
Copy link
Contributor Author

shrshi commented Jan 10, 2025

/ok to test

@shrshi shrshi mentioned this pull request Jan 11, 2025
3 tasks
@vuule vuule self-requested a review January 15, 2025 17:36
Comment on lines 139 to 153
std::string json_string_b1 = R"(
{ "a": { "y" : 6}, "b" : [1, 2, 3], "c": 11 }
{ "a": { "y" : 6}, "b" : [4, 5 ], "c": 12 }
{ "a": { "y" : 6}, "b" : [6 ], "c": 13 }
{ "a": { "y" : 6}, "b" : [7 ], "c": 14 })";
std::string json_string_b2 = R"(
{ "a": { "y" : 6}, "c": 11 }
{ "a": { "y" : 6}, "b" : [4, 5 ], "c": 12 }
{ "a": { "y" : 6}, "b" : [6 ], "c": 13 }
{ "a": { "y" : 6}, "b" : [7 ], "c": 14 })";
std::string json_string_b3 = R"(
{ "a": { "y" : 6}}
{ "a": { "y" : 6}, "b" : [4, 5 ], "c": 12 }
{ "a": { "y" : 6}, "b" : [6 ], "c": 13 }
{ "a": { "y" : 6}, "b" : [7 ], "c": 14 })";
Copy link
Contributor

Choose a reason for hiding this comment

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

how are the schemas different between these three?
I suspect that json_string_b1 is "a","b","c" json_string_b2 is "a","c","b", but I can't tell what json_string_b3 leads to.
A comment on what the test case here is would be great.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The column ordering is different across batches - we set the batch size to the size of first string json_string_b1. And we enforce the same ordering on batches 2 and 3.

cpp/tests/large_strings/json_tests.cu Outdated Show resolved Hide resolved
cpp/src/io/json/read_json.cu Outdated Show resolved Hide resolved
cpp/src/io/json/read_json.cu Outdated Show resolved Hide resolved
cpp/src/io/json/read_json.cu Outdated Show resolved Hide resolved
cpp/src/io/json/read_json.cu Outdated Show resolved Hide resolved
cpp/src/io/json/read_json.cu Outdated Show resolved Hide resolved
cpp/src/io/json/read_json.cu Outdated Show resolved Hide resolved
Copy link

copy-pr-bot bot commented Jan 22, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@shrshi
Copy link
Contributor Author

shrshi commented Jan 22, 2025

/ok to test

@shrshi shrshi requested a review from vuule January 23, 2025 00:00
Copy link
Contributor

@vuule vuule left a comment

Choose a reason for hiding this comment

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

looks good, just one small style suggestion

cpp/src/io/json/read_json.cu Outdated Show resolved Hide resolved
@shrshi
Copy link
Contributor Author

shrshi commented Jan 23, 2025

/ok to test

@shrshi shrshi added the 5 - Ready to Merge Testing and reviews complete, ready to merge label Jan 24, 2025
@shrshi
Copy link
Contributor Author

shrshi commented Jan 24, 2025

/ok to test

@shrshi
Copy link
Contributor Author

shrshi commented Jan 24, 2025

/ok to test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Ready to Merge Testing and reviews complete, ready to merge bug Something isn't working cuIO cuIO issue libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change
Projects
Status: Burndown
4 participants