-
Notifications
You must be signed in to change notification settings - Fork 62
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
For ExprFunction, replace Environment with EvaluationSession #559
Conversation
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.
So I think this PR mainly changes Environment
from public to internal. I think we should do so, even if this could break users' code, as users should not access it by design.
@@ -25,7 +25,7 @@ import java.util.TreeMap | |||
* @param session The evaluation session. | |||
* @param groups The map of [Group]s that is currently being built during query execution. | |||
*/ | |||
data class Environment( | |||
internal data class Environment( |
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.
Nit: Currently the description in kdoc is "the environment for execution". Do you think is makes more sense to change it to "variables environment used during evaluation"?
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.
I think this version of the class is not just for variables--it includes groups
too so the existing wording is more appropriate, IMHO. Anyway, perhaps that is outside the scope of this CR.
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.
Then can we change it as "environment used during evaluation"? I think "execution" in the original definition is not really clear.
gradle.properties
Outdated
#kotlin.daemon.jvmargs="-Xmx8g" | ||
org.gradle.jvmargs="-Xmx8g" |
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.
Why do we need to add these 2 lines?
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.
I forgot to remove this--it might be needed a bit later.
I am working on a significant evaluator refactor to work with the new relational algebra. There is a requirement that this be implemented as a refactored copy of the original
EvaluatingCompiler
to allow customers to switch between the old and new evaluators via runtime configuration. One challenge associated with this is: the new evaluator does not use the sameEnvironment
class of the legacy evaluator and (until this PR) and theExprFunction.call*
functions all acceptedEnvironment
as a first argument. This PR changes that argument tosession: EvaluationSession
instead. Unfortunately, this is a breaking API change and customers who have their ownExprFunction
implementations. (Although this has gone through a breaking change in the last release anyway and most of our customers probably haven't migrated yet.) There is, however, no other way that I can see to accomplish the goal of exposing the new physical plan evaluator as an alternative to the legacy AST evaluator.Aside from the above:
Environment
as public API wasn't a great idea because it exposed implementation details that the customer should never depend on (i.e. all of the properties here except forsession
).env: Environment
parameter. Nor is there any reason to that I am aware of, outside of accessing itssession: EvaluationSession
property.This PR also makes
Environment
and several other typesinternal
as well. These other types were all implementation details that customers should not be depending on and could not be madeinternal
previously due to the requirement thatEnvironment
be public.