-
Notifications
You must be signed in to change notification settings - Fork 902
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
Expose expression base class publicly and simplify public AST API #9045
Conversation
…r to recompilation of AST-consuming code when AST internals change.
@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. |
rerun tests |
@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? |
There was a problem hiding this 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/test/java/ai/rapids/cudf/ast/CompiledExpressionTest.java
Outdated
Show resolved
Hide resolved
…add support for this in expression compilation.
@gpucibot merge |
This PR performs the renames
ast::expression
->ast::operation
andast::node
->ast::expression
, which more accurately reflects that literals and column references are also valid expressions. The newexpression
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 oldnodes.hpp
andoperators.hpp
files have been merged into a singleexpressions.hpp
header that now contains the entire public API for AST construction, but some implementation details have been moved into anexpressions.cpp
source file so dependencies on detail APIs like theexpression_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.