SessionContext from ExecutionEngine
Implement now function using SessionContext managed by the execution engine. Unlike #937 this implementation decouples the function definition from capturing query start time.
In addition, this declaration of Expression.valueOf allows for passing other metadata to function implementations.
Implementation overview
SessionContext is a class that stores query execution start time.
It is provided to now implementation through an argument to Expression.valueOf.
That is done by ProjectOperator while executing
ExecutionEngine provides an instance of SessionContext to each PhyiscalPlan by calling PhysicalPlan.open.
Remaining work
Ensure that SessionContext is passed in all instances where an expression can contain now() call.
Signed-off-by: MaxKsyunz [email protected]
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check here.
@penghuo what do you think of this implementation of query context (I called it SessionContext here). In this case, the value is provided at execution time, not function definition.
Will revisit this later.