-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Minor: Add getter for logical optimizer rules #12379
Conversation
This is my first time contributing. Please let me know if I missed any. Tagging for CI, @alamb @andygrove |
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.
LGTM! Thanks @maronavenue
|
||
#[test] | ||
fn test_session_state_with_optimizer_rules() { | ||
// test building sessions with supplied rules |
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
// test building sessions with supplied rules | |
struct DummyRule {} | |
impl OptimizerRule for DummyRule { | |
fn name(&self) -> &str { | |
"dummy_rule" | |
} | |
} | |
// test building sessions with supplied rules |
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.
|
||
struct DummyRule {} | ||
|
||
impl OptimizerRule for DummyRule { | ||
fn name(&self) -> &str { | ||
"dummy_rule" | ||
} | ||
} |
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
struct DummyRule {} | |
impl OptimizerRule for DummyRule { | |
fn name(&self) -> &str { | |
"dummy_rule" | |
} | |
} |
Thanks @maronavenue for contribution and @Dandandan for review |
Which issue does this PR close?
N/A
Rationale for this change
My team and I have been exploring Datafusion's potential to federate our custom sources performantly. Part of that is tuning optimizers depending on our needs. Noticed that there isn't a convenience method in
SessionState
yet that returns logical optimizer rules compared to its physical counterpart. Would be great for our POC work to quickly inspect them outside (and/or alongside) debugger or observer.What changes are included in this PR?
Adds a getter method
optimizers()
inSessionState
in parity to thephysical_optimizers()
counterpart.Are these changes tested?
Yes, ran new and existing tests. Also manually tested from our existing POC code.
Are there any user-facing changes?
Examples: