-
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
Require Debug
for AnalyzerRule
, FunctionRewriter
, and OptimizerRule
#12556
Conversation
@@ -100,6 +100,7 @@ pub async fn main() -> Result<()> { | |||
|
|||
/// An example OptimizerRule that replaces all `col = <const>` predicates with a | |||
/// user defined function | |||
#[derive(Default, Debug)] |
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 the end user visible change -- basically you have to #[derive(Debug)]
if you haven't already
@@ -72,7 +74,7 @@ pub trait AnalyzerRule { | |||
/// | |||
/// An `Analyzer` transforms a `LogicalPlan` | |||
/// prior to the rest of the DataFusion optimization process. | |||
#[derive(Clone)] | |||
#[derive(Clone, Debug)] |
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.
It will be nice to be able to see what rules are registered with the analyzer/optimizer
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 @alamb It's a nice change for the user who wants to implement the custom 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.
👍
🚀 |
Which issue does this PR close?
Part of #12555
Rationale for this change
I would like DataFusion to be easiser to configure and use, and having
Debug
impls forcommon structs would be a big help.
What changes are included in this PR?
Debug
forAnalyzerRule
,FunctionRewriter
, andOptimizerRule
#derive
this trait as necessaryAre these changes tested?
Yes buy CI and the compiler
Are there any user-facing changes?
Technically this is an API change as it also adds the requirement for Debug for various optimizer rules, but I think that is good thing.