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

Expose expression base class publicly and simplify public AST API #9045

Merged
merged 25 commits into from
Aug 18, 2021

Conversation

vyasr
Copy link
Contributor

@vyasr vyasr commented Aug 16, 2021

This PR performs the renames ast::expression->ast::operation and ast::node->ast::expression, which more accurately reflects that literals and column references are also valid expressions. The new expression class is publicly exposed, allowing client code to maintain a list of expression pointers composed of different subclasses of expression, and all APIs now accept arbitrary expressions as input so that it is possible to evaluate e.g. a raw column reference on a table. The old nodes.hpp and operators.hpp files have been merged into a single expressions.hpp header that now contains the entire public API for AST construction, but some implementation details have been moved into an expressions.cpp source file so dependencies on detail APIs like the expression_parser are restricted to a single TU, which dramatically simplifies recompilation of the code on small changes. Many more parameters are now accepted by (const) ref rather than by value, avoiding unnecessary copies and improving const correctness of the code.

@vyasr vyasr added 2 - In Progress Currently a work in progress libcudf Affects libcudf (C++/CUDA) code. improvement Improvement / enhancement to an existing function breaking Breaking change labels Aug 16, 2021
@vyasr vyasr added this to the Conditional Joins milestone Aug 16, 2021
@vyasr vyasr self-assigned this Aug 16, 2021
@vyasr vyasr requested a review from a team as a code owner August 16, 2021 18:19
@vyasr vyasr requested a review from a team as a code owner August 16, 2021 18:19
@github-actions github-actions bot added the CMake CMake build issue label Aug 16, 2021
@vyasr vyasr mentioned this pull request Aug 16, 2021
10 tasks
@vyasr
Copy link
Contributor Author

vyasr commented Aug 16, 2021

@jlowe this PR addresses a number of the issues that we have discussed offline (some of which are captured in #8145). Java tests will not pass until I update those bindings (I'm happy to take a stab at it), but I'd like to reach consensus on the C++ changes first so that we can make sure we're on the same page with the API.

@github-actions github-actions bot added the conda label Aug 16, 2021
@vyasr vyasr requested a review from a team as a code owner August 17, 2021 16:36
@vyasr vyasr added 3 - Ready for Review Ready for review by team and removed 2 - In Progress Currently a work in progress labels Aug 17, 2021
@vyasr vyasr requested a review from jlowe August 17, 2021 16:39
@vyasr
Copy link
Contributor Author

vyasr commented Aug 17, 2021

rerun tests

@vyasr vyasr requested a review from jlowe August 18, 2021 00:01
@vyasr
Copy link
Contributor Author

vyasr commented Aug 18, 2021

@jlowe once this PR is approved would it be best to hold off merging until you've had a chance to update the sparks-rapids consumers of this API?

Copy link
Member

@jlowe jlowe left a comment

Choose a reason for hiding this comment

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

would it be best to hold off merging until you've had a chance to update the sparks-rapids consumers of this API?

I should have a draft PR to update the RAPIDS Accelerator later today, so I don't think there's a need to wait.

java/src/main/native/src/jni_compiled_expr.hpp Outdated Show resolved Hide resolved
@vyasr vyasr requested a review from jlowe August 18, 2021 17:25
@vyasr
Copy link
Contributor Author

vyasr commented Aug 18, 2021

@gpucibot merge

@rapids-bot rapids-bot bot merged commit 04b7027 into rapidsai:branch-21.10 Aug 18, 2021
@vyasr vyasr deleted the refactor/expressions branch January 14, 2022 18:06
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 breaking Breaking change CMake CMake build issue improvement Improvement / enhancement to an existing function Java Affects Java cuDF API. libcudf Affects libcudf (C++/CUDA) code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants