-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
WIP: Remove ExecutionProps
from OptimizerRule
trait
#2602
WIP: Remove ExecutionProps
from OptimizerRule
trait
#2602
Conversation
@@ -1130,7 +1130,7 @@ impl SessionConfig { | |||
/// done so during predicate pruning and expression simplification | |||
#[derive(Clone)] | |||
pub struct ExecutionProps { | |||
pub(crate) query_execution_start_time: DateTime<Utc>, | |||
pub(crate) query_execution_start_time: Arc<Mutex<DateTime<Utc>>>, |
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 mutex is not needed?
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.
Thanks. You are right, I have removed it.
SessionState { | ||
session_id, | ||
optimizers: vec![ | ||
// Simplify expressions first to maximize the chance | ||
// of applying other optimizations | ||
Arc::new(SimplifyExpressions::new()), | ||
Arc::new(SimplifyExpressions::new(execution_props.clone())), |
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.
~This is not correct. We need the same ExecutionProps
to be shared between SessionState
and SimplifyExpressions
so that they both have the same execution start time. ~
130e402
to
053c8a6
Compare
ExecutionProps
from OptimizerRule
traitExecutionProps
from OptimizerRule
trait
I'm moving this back to draft for now. The Perhaps we need to provide the optimizer rules with a trait for accessing certain system state. |
Which issue does this PR close?
Part of #2599 and #2535
Rationale for this change
The logical optimizer rules should not depend on execution properties and only one of them currently does (SimplifyExpressions - which also depends on the physical query planner).
What changes are included in this PR?
ExecutionProps
fromOptimizerRule
execution_props
toSimplifyExpressions
ruleAre there any user-facing changes?
No
Does this PR break compatibility with Ballista?
No