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

Add in option for Java JSON APIs to do column pruning in CUDF #16796

Merged
merged 5 commits into from
Sep 24, 2024

Conversation

revans2
Copy link
Contributor

@revans2 revans2 commented Sep 11, 2024

Description

This adds in the options to enable column_pruning when reading JSON using the java APIs.

This is still in draft because there are test failures if this is turned on for those tests.

#16797

That said the performance impact from enabling column pruning on some queries is huge. For one query in particular the current code takes 161.5 seconds and with CUDF column pruning it is just 16.5 seconds. That is a 10x speedup for something that is fairly real world.

Checklist

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

@github-actions github-actions bot added the Java Affects Java cuDF API. label Sep 11, 2024
@revans2 revans2 added 0 - Blocked Cannot progress due to external reasons Performance Performance related issue Spark Functionality that helps Spark RAPIDS improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Sep 11, 2024
@revans2 revans2 mentioned this pull request Sep 20, 2024
3 tasks
@revans2
Copy link
Contributor Author

revans2 commented Sep 20, 2024

This makes a big difference in performance on a number of real world use cases we have seen (160 seconds without vs 16.7 seconds with pruning) In order to not have any accuracy regressions this depends on #16545 going in.

@@ -1313,7 +1315,8 @@ public static Table readJSON(Schema schema, JSONOptions opts, File path) {
opts.strictValidation(),
opts.leadingZerosAllowed(),
opts.nonNumericNumbersAllowed(),
opts.unquotedControlChars()))) {
opts.unquotedControlChars(),
true))) {
Copy link
Contributor

@ttnghia ttnghia Sep 20, 2024

Choose a reason for hiding this comment

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

Why it is always true while in the other overload it is a parameter?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch I missed that one

@revans2
Copy link
Contributor Author

revans2 commented Sep 20, 2024

@ttnghia please take another look

Comment on lines +1314 to +1315
boolean cudfPruneSchema = schema.getColumnNames() != null &&
schema.getColumnNames().length != 0 &&
Copy link
Contributor

Choose a reason for hiding this comment

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

Since getColumnNames calls toArray, consider storing it in a local variable. Maybe we could introduce a utils method since this PR does it a few times.

@revans2 revans2 marked this pull request as ready for review September 24, 2024 13:20
@revans2 revans2 requested a review from a team as a code owner September 24, 2024 13:20
@revans2 revans2 added 3 - Ready for Review Ready for review by team and removed 0 - Blocked Cannot progress due to external reasons labels Sep 24, 2024
@revans2
Copy link
Contributor Author

revans2 commented Sep 24, 2024

I need to clarify the dependency a bit. This code should not break anything if it goes in before #16797, but it will not hurt anything because pruning in CUDF is disabled by default.

@revans2
Copy link
Contributor Author

revans2 commented Sep 24, 2024

/merge

@rapids-bot rapids-bot bot merged commit b3518ab into rapidsai:branch-24.10 Sep 24, 2024
83 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Ready for Review Ready for review by team improvement Improvement / enhancement to an existing function Java Affects Java cuDF API. non-breaking Non-breaking change Performance Performance related issue Spark Functionality that helps Spark RAPIDS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants