From a75220cb721cca242918e24a61dbeb0c216f61e4 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Fri, 20 Sep 2024 09:04:19 -0400 Subject: [PATCH] Require `Debug` for `AnalyzerRule`, `FunctionRewriter`, and `OptimizerRule` --- datafusion-examples/examples/optimizer_rule.rs | 1 + datafusion/core/src/execution/session_state.rs | 1 + datafusion/core/tests/user_defined/user_defined_plan.rs | 3 +++ datafusion/expr/src/expr_rewriter/mod.rs | 3 ++- datafusion/optimizer/src/analyzer/count_wildcard_rule.rs | 2 +- datafusion/optimizer/src/analyzer/expand_wildcard_rule.rs | 2 +- datafusion/optimizer/src/analyzer/function_rewrite.rs | 2 +- datafusion/optimizer/src/analyzer/inline_table_scan.rs | 2 +- datafusion/optimizer/src/analyzer/mod.rs | 6 ++++-- datafusion/optimizer/src/analyzer/type_coercion.rs | 2 +- datafusion/optimizer/src/common_subexpr_eliminate.rs | 1 + .../optimizer/src/decorrelate_predicate_subquery.rs | 2 +- datafusion/optimizer/src/eliminate_cross_join.rs | 2 +- datafusion/optimizer/src/eliminate_duplicated_expr.rs | 2 +- datafusion/optimizer/src/eliminate_filter.rs | 2 +- datafusion/optimizer/src/eliminate_group_by_constant.rs | 2 +- datafusion/optimizer/src/eliminate_join.rs | 2 +- datafusion/optimizer/src/eliminate_limit.rs | 2 +- datafusion/optimizer/src/eliminate_nested_union.rs | 2 +- datafusion/optimizer/src/eliminate_one_union.rs | 2 +- datafusion/optimizer/src/eliminate_outer_join.rs | 2 +- datafusion/optimizer/src/extract_equijoin_predicate.rs | 2 +- datafusion/optimizer/src/filter_null_join_keys.rs | 2 +- datafusion/optimizer/src/optimize_projections/mod.rs | 2 +- datafusion/optimizer/src/optimizer.rs | 8 ++++++-- datafusion/optimizer/src/propagate_empty_relation.rs | 2 +- datafusion/optimizer/src/push_down_filter.rs | 2 +- datafusion/optimizer/src/push_down_limit.rs | 2 +- datafusion/optimizer/src/replace_distinct_aggregate.rs | 2 +- datafusion/optimizer/src/rewrite_disjunctive_predicate.rs | 2 +- datafusion/optimizer/src/scalar_subquery_to_join.rs | 2 +- .../optimizer/src/simplify_expressions/simplify_exprs.rs | 2 +- datafusion/optimizer/src/single_distinct_to_groupby.rs | 2 +- datafusion/optimizer/src/unwrap_cast_in_comparison.rs | 2 +- 34 files changed, 45 insertions(+), 32 deletions(-) diff --git a/datafusion-examples/examples/optimizer_rule.rs b/datafusion-examples/examples/optimizer_rule.rs index b4663b345f64..e0b552620a9a 100644 --- a/datafusion-examples/examples/optimizer_rule.rs +++ b/datafusion-examples/examples/optimizer_rule.rs @@ -100,6 +100,7 @@ pub async fn main() -> Result<()> { /// An example OptimizerRule that replaces all `col = ` predicates with a /// user defined function +#[derive(Default, Debug)] struct MyOptimizerRule {} impl OptimizerRule for MyOptimizerRule { diff --git a/datafusion/core/src/execution/session_state.rs b/datafusion/core/src/execution/session_state.rs index f656fae4016f..06779340354d 100644 --- a/datafusion/core/src/execution/session_state.rs +++ b/datafusion/core/src/execution/session_state.rs @@ -1905,6 +1905,7 @@ mod tests { #[test] fn test_session_state_with_optimizer_rules() { + #[derive(Default, Debug)] struct DummyRule {} impl OptimizerRule for DummyRule { diff --git a/datafusion/core/tests/user_defined/user_defined_plan.rs b/datafusion/core/tests/user_defined/user_defined_plan.rs index 56edeab443c7..a1736498e589 100644 --- a/datafusion/core/tests/user_defined/user_defined_plan.rs +++ b/datafusion/core/tests/user_defined/user_defined_plan.rs @@ -335,7 +335,9 @@ impl QueryPlanner for TopKQueryPlanner { } } +#[derive(Default, Debug)] struct TopKOptimizerRule {} + impl OptimizerRule for TopKOptimizerRule { fn name(&self) -> &str { "topk" @@ -686,6 +688,7 @@ impl RecordBatchStream for TopKReader { } } +#[derive(Default, Debug)] struct MyAnalyzerRule {} impl AnalyzerRule for MyAnalyzerRule { diff --git a/datafusion/expr/src/expr_rewriter/mod.rs b/datafusion/expr/src/expr_rewriter/mod.rs index 05ee3e112d62..15930914dd59 100644 --- a/datafusion/expr/src/expr_rewriter/mod.rs +++ b/datafusion/expr/src/expr_rewriter/mod.rs @@ -19,6 +19,7 @@ use std::collections::HashMap; use std::collections::HashSet; +use std::fmt::Debug; use std::sync::Arc; use crate::expr::{Alias, Sort, Unnest}; @@ -42,7 +43,7 @@ pub use order_by::rewrite_sort_cols_by_aggs; /// `Operator::ArrowAt`, but can be implemented by calling a function /// `array_concat` from the `functions-nested` crate. // This is not used in datafusion internally, but it is still helpful for downstream project so don't remove it. -pub trait FunctionRewrite { +pub trait FunctionRewrite: Debug { /// Return a human readable name for this rewrite fn name(&self) -> &str; diff --git a/datafusion/optimizer/src/analyzer/count_wildcard_rule.rs b/datafusion/optimizer/src/analyzer/count_wildcard_rule.rs index 32ca790b0094..86520b3587cd 100644 --- a/datafusion/optimizer/src/analyzer/count_wildcard_rule.rs +++ b/datafusion/optimizer/src/analyzer/count_wildcard_rule.rs @@ -28,7 +28,7 @@ use datafusion_expr::{lit, Expr, LogicalPlan, WindowFunctionDefinition}; /// Rewrite `Count(Expr:Wildcard)` to `Count(Expr:Literal)`. /// /// Resolves issue: -#[derive(Default)] +#[derive(Default, Debug)] pub struct CountWildcardRule {} impl CountWildcardRule { diff --git a/datafusion/optimizer/src/analyzer/expand_wildcard_rule.rs b/datafusion/optimizer/src/analyzer/expand_wildcard_rule.rs index b2de541a34c7..a26ec4be5c85 100644 --- a/datafusion/optimizer/src/analyzer/expand_wildcard_rule.rs +++ b/datafusion/optimizer/src/analyzer/expand_wildcard_rule.rs @@ -28,7 +28,7 @@ use datafusion_expr::utils::{ }; use datafusion_expr::{Expr, LogicalPlan, Projection, SubqueryAlias}; -#[derive(Default)] +#[derive(Default, Debug)] pub struct ExpandWildcardRule {} impl ExpandWildcardRule { diff --git a/datafusion/optimizer/src/analyzer/function_rewrite.rs b/datafusion/optimizer/src/analyzer/function_rewrite.rs index ec3626b2c899..c6bf14ebce2e 100644 --- a/datafusion/optimizer/src/analyzer/function_rewrite.rs +++ b/datafusion/optimizer/src/analyzer/function_rewrite.rs @@ -29,7 +29,7 @@ use datafusion_expr::LogicalPlan; use std::sync::Arc; /// Analyzer rule that invokes [`FunctionRewrite`]s on expressions -#[derive(Default)] +#[derive(Default, Debug)] pub struct ApplyFunctionRewrites { /// Expr --> Function writes to apply function_rewrites: Vec>, diff --git a/datafusion/optimizer/src/analyzer/inline_table_scan.rs b/datafusion/optimizer/src/analyzer/inline_table_scan.rs index 2fc9b91da6cb..342d85a915b4 100644 --- a/datafusion/optimizer/src/analyzer/inline_table_scan.rs +++ b/datafusion/optimizer/src/analyzer/inline_table_scan.rs @@ -28,7 +28,7 @@ use datafusion_expr::{logical_plan::LogicalPlan, Expr, LogicalPlanBuilder}; /// Analyzed rule that inlines TableScan that provide a [`LogicalPlan`] /// (DataFrame / ViewTable) -#[derive(Default)] +#[derive(Default, Debug)] pub struct InlineTableScan; impl InlineTableScan { diff --git a/datafusion/optimizer/src/analyzer/mod.rs b/datafusion/optimizer/src/analyzer/mod.rs index 6e2afeca88c9..4cd891664e7f 100644 --- a/datafusion/optimizer/src/analyzer/mod.rs +++ b/datafusion/optimizer/src/analyzer/mod.rs @@ -16,6 +16,8 @@ // under the License. //! [`Analyzer`] and [`AnalyzerRule`] + +use std::fmt::Debug; use std::sync::Arc; use log::debug; @@ -60,7 +62,7 @@ pub mod type_coercion; /// `AnalyzerRule`s. /// /// [`SessionState::add_analyzer_rule`]: https://docs.rs/datafusion/latest/datafusion/execution/session_state/struct.SessionState.html#method.add_analyzer_rule -pub trait AnalyzerRule { +pub trait AnalyzerRule: Debug { /// Rewrite `plan` fn analyze(&self, plan: LogicalPlan, config: &ConfigOptions) -> Result; @@ -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)] pub struct Analyzer { /// Expr --> Function writes to apply prior to analysis passes pub function_rewrites: Vec>, diff --git a/datafusion/optimizer/src/analyzer/type_coercion.rs b/datafusion/optimizer/src/analyzer/type_coercion.rs index 7a8746572cfd..71f9c64aae3f 100644 --- a/datafusion/optimizer/src/analyzer/type_coercion.rs +++ b/datafusion/optimizer/src/analyzer/type_coercion.rs @@ -57,7 +57,7 @@ use datafusion_expr::{ /// Performs type coercion by determining the schema /// and performing the expression rewrites. -#[derive(Default)] +#[derive(Default, Debug)] pub struct TypeCoercion {} impl TypeCoercion { diff --git a/datafusion/optimizer/src/common_subexpr_eliminate.rs b/datafusion/optimizer/src/common_subexpr_eliminate.rs index 442cc93f5b93..c13cb3a8e973 100644 --- a/datafusion/optimizer/src/common_subexpr_eliminate.rs +++ b/datafusion/optimizer/src/common_subexpr_eliminate.rs @@ -139,6 +139,7 @@ type CommonExprs<'n> = IndexMap, (Expr, String)>; /// ProjectionExec(exprs=[extract (day from new_col), extract (year from new_col)]) <-- reuse here /// ProjectionExec(exprs=[to_date(c1) as new_col]) <-- compute to_date once /// ``` +#[derive(Debug)] pub struct CommonSubexprEliminate { random_state: RandomState, } diff --git a/datafusion/optimizer/src/decorrelate_predicate_subquery.rs b/datafusion/optimizer/src/decorrelate_predicate_subquery.rs index 5bb57bf05f62..d1ac80003ba7 100644 --- a/datafusion/optimizer/src/decorrelate_predicate_subquery.rs +++ b/datafusion/optimizer/src/decorrelate_predicate_subquery.rs @@ -40,7 +40,7 @@ use datafusion_expr::{ use log::debug; /// Optimizer rule for rewriting predicate(IN/EXISTS) subquery to left semi/anti joins -#[derive(Default)] +#[derive(Default, Debug)] pub struct DecorrelatePredicateSubquery {} impl DecorrelatePredicateSubquery { diff --git a/datafusion/optimizer/src/eliminate_cross_join.rs b/datafusion/optimizer/src/eliminate_cross_join.rs index 93df0dcfd500..550728ddd3f9 100644 --- a/datafusion/optimizer/src/eliminate_cross_join.rs +++ b/datafusion/optimizer/src/eliminate_cross_join.rs @@ -30,7 +30,7 @@ use datafusion_expr::logical_plan::{ use datafusion_expr::utils::{can_hash, find_valid_equijoin_key_pair}; use datafusion_expr::{build_join_schema, ExprSchemable, Operator}; -#[derive(Default)] +#[derive(Default, Debug)] pub struct EliminateCrossJoin; impl EliminateCrossJoin { diff --git a/datafusion/optimizer/src/eliminate_duplicated_expr.rs b/datafusion/optimizer/src/eliminate_duplicated_expr.rs index c460d7a93d26..554985667fdf 100644 --- a/datafusion/optimizer/src/eliminate_duplicated_expr.rs +++ b/datafusion/optimizer/src/eliminate_duplicated_expr.rs @@ -26,7 +26,7 @@ use datafusion_expr::{Aggregate, Expr, Sort, SortExpr}; use indexmap::IndexSet; use std::hash::{Hash, Hasher}; /// Optimization rule that eliminate duplicated expr. -#[derive(Default)] +#[derive(Default, Debug)] pub struct EliminateDuplicatedExpr; impl EliminateDuplicatedExpr { diff --git a/datafusion/optimizer/src/eliminate_filter.rs b/datafusion/optimizer/src/eliminate_filter.rs index bb2b4547e9c2..4ed2ac8ba1a4 100644 --- a/datafusion/optimizer/src/eliminate_filter.rs +++ b/datafusion/optimizer/src/eliminate_filter.rs @@ -30,7 +30,7 @@ use crate::{OptimizerConfig, OptimizerRule}; /// /// This saves time in planning and executing the query. /// Note that this rule should be applied after simplify expressions optimizer rule. -#[derive(Default)] +#[derive(Default, Debug)] pub struct EliminateFilter; impl EliminateFilter { diff --git a/datafusion/optimizer/src/eliminate_group_by_constant.rs b/datafusion/optimizer/src/eliminate_group_by_constant.rs index c7869d9e4dd7..13d03d647fe2 100644 --- a/datafusion/optimizer/src/eliminate_group_by_constant.rs +++ b/datafusion/optimizer/src/eliminate_group_by_constant.rs @@ -26,7 +26,7 @@ use datafusion_expr::{Aggregate, Expr, LogicalPlan, LogicalPlanBuilder, Volatili /// Optimizer rule that removes constant expressions from `GROUP BY` clause /// and places additional projection on top of aggregation, to preserve /// original schema -#[derive(Default)] +#[derive(Default, Debug)] pub struct EliminateGroupByConstant {} impl EliminateGroupByConstant { diff --git a/datafusion/optimizer/src/eliminate_join.rs b/datafusion/optimizer/src/eliminate_join.rs index b15d981d1180..f9b79e036f9b 100644 --- a/datafusion/optimizer/src/eliminate_join.rs +++ b/datafusion/optimizer/src/eliminate_join.rs @@ -28,7 +28,7 @@ use datafusion_expr::{ /// Eliminates joins when join condition is false. /// Replaces joins when inner join condition is true with a cross join. -#[derive(Default)] +#[derive(Default, Debug)] pub struct EliminateJoin; impl EliminateJoin { diff --git a/datafusion/optimizer/src/eliminate_limit.rs b/datafusion/optimizer/src/eliminate_limit.rs index 2503475bd8df..25304d4ccafa 100644 --- a/datafusion/optimizer/src/eliminate_limit.rs +++ b/datafusion/optimizer/src/eliminate_limit.rs @@ -30,7 +30,7 @@ use std::sync::Arc; /// plan with an empty relation. /// /// This rule also removes OFFSET 0 from the [LogicalPlan] -#[derive(Default)] +#[derive(Default, Debug)] pub struct EliminateLimit; impl EliminateLimit { diff --git a/datafusion/optimizer/src/eliminate_nested_union.rs b/datafusion/optimizer/src/eliminate_nested_union.rs index 965771326854..94da08243d78 100644 --- a/datafusion/optimizer/src/eliminate_nested_union.rs +++ b/datafusion/optimizer/src/eliminate_nested_union.rs @@ -25,7 +25,7 @@ use datafusion_expr::{Distinct, LogicalPlan, Union}; use itertools::Itertools; use std::sync::Arc; -#[derive(Default)] +#[derive(Default, Debug)] /// An optimization rule that replaces nested unions with a single union. pub struct EliminateNestedUnion; diff --git a/datafusion/optimizer/src/eliminate_one_union.rs b/datafusion/optimizer/src/eliminate_one_union.rs index 7a1c4e118e05..3e027811420c 100644 --- a/datafusion/optimizer/src/eliminate_one_union.rs +++ b/datafusion/optimizer/src/eliminate_one_union.rs @@ -24,7 +24,7 @@ use std::sync::Arc; use crate::optimizer::ApplyOrder; -#[derive(Default)] +#[derive(Default, Debug)] /// An optimization rule that eliminates union with one element. pub struct EliminateOneUnion; diff --git a/datafusion/optimizer/src/eliminate_outer_join.rs b/datafusion/optimizer/src/eliminate_outer_join.rs index e7c88df55122..1ecb32ca2a43 100644 --- a/datafusion/optimizer/src/eliminate_outer_join.rs +++ b/datafusion/optimizer/src/eliminate_outer_join.rs @@ -26,7 +26,6 @@ use datafusion_common::tree_node::Transformed; use datafusion_expr::expr::{BinaryExpr, Cast, TryCast}; use std::sync::Arc; -#[derive(Default)] /// /// Attempt to replace outer joins with inner joins. /// @@ -49,6 +48,7 @@ use std::sync::Arc; /// filters from the WHERE clause return false while any inputs are /// null and columns of those quals are come from nullable side of /// outer join. +#[derive(Default, Debug)] pub struct EliminateOuterJoin; impl EliminateOuterJoin { diff --git a/datafusion/optimizer/src/extract_equijoin_predicate.rs b/datafusion/optimizer/src/extract_equijoin_predicate.rs index 0dae777ab5bd..48191ec20631 100644 --- a/datafusion/optimizer/src/extract_equijoin_predicate.rs +++ b/datafusion/optimizer/src/extract_equijoin_predicate.rs @@ -38,7 +38,7 @@ type EquijoinPredicate = (Expr, Expr); /// has one equijoin predicate (`A.x = B.y`) and one filter predicate (`B.z > 50`). /// See [find_valid_equijoin_key_pair] for more information on what predicates /// are considered equijoins. -#[derive(Default)] +#[derive(Default, Debug)] pub struct ExtractEquijoinPredicate; impl ExtractEquijoinPredicate { diff --git a/datafusion/optimizer/src/filter_null_join_keys.rs b/datafusion/optimizer/src/filter_null_join_keys.rs index caf94a2c88bd..66c7463c3d5d 100644 --- a/datafusion/optimizer/src/filter_null_join_keys.rs +++ b/datafusion/optimizer/src/filter_null_join_keys.rs @@ -29,7 +29,7 @@ use std::sync::Arc; /// The FilterNullJoinKeys rule will identify joins with equi-join conditions /// where the join key is nullable and then insert an `IsNotNull` filter on the nullable side since null values /// can never match. -#[derive(Default)] +#[derive(Default, Debug)] pub struct FilterNullJoinKeys {} impl OptimizerRule for FilterNullJoinKeys { diff --git a/datafusion/optimizer/src/optimize_projections/mod.rs b/datafusion/optimizer/src/optimize_projections/mod.rs index 65db164c6e55..8132885b1d29 100644 --- a/datafusion/optimizer/src/optimize_projections/mod.rs +++ b/datafusion/optimizer/src/optimize_projections/mod.rs @@ -57,7 +57,7 @@ use datafusion_common::tree_node::{ /// The rule analyzes the input logical plan, determines the necessary column /// indices, and then removes any unnecessary columns. It also removes any /// unnecessary projections from the plan tree. -#[derive(Default)] +#[derive(Default, Debug)] pub struct OptimizeProjections {} impl OptimizeProjections { diff --git a/datafusion/optimizer/src/optimizer.rs b/datafusion/optimizer/src/optimizer.rs index 2fc560cceeb4..08dcefa22f08 100644 --- a/datafusion/optimizer/src/optimizer.rs +++ b/datafusion/optimizer/src/optimizer.rs @@ -18,6 +18,7 @@ //! [`Optimizer`] and [`OptimizerRule`] use std::collections::HashSet; +use std::fmt::Debug; use std::sync::Arc; use chrono::{DateTime, Utc}; @@ -70,7 +71,7 @@ use crate::utils::log_plan; /// [`AnalyzerRule`]: crate::analyzer::AnalyzerRule /// [`SessionState::add_optimizer_rule`]: https://docs.rs/datafusion/latest/datafusion/execution/session_state/struct.SessionState.html#method.add_optimizer_rule -pub trait OptimizerRule { +pub trait OptimizerRule: Debug { /// Try and rewrite `plan` to an optimized form, returning None if the plan /// cannot be optimized by this rule. /// @@ -214,7 +215,7 @@ impl OptimizerConfig for OptimizerContext { } /// A rule-based optimizer. -#[derive(Clone)] +#[derive(Clone, Debug)] pub struct Optimizer { /// All optimizer rules to apply pub rules: Vec>, @@ -666,6 +667,7 @@ mod tests { fn observe(_plan: &LogicalPlan, _rule: &dyn OptimizerRule) {} + #[derive(Default, Debug)] struct BadRule {} impl OptimizerRule for BadRule { @@ -687,6 +689,7 @@ mod tests { } /// Replaces whatever plan with a single table scan + #[derive(Default, Debug)] struct GetTableScanRule {} impl OptimizerRule for GetTableScanRule { @@ -713,6 +716,7 @@ mod tests { /// A goofy rule doing rotation of columns in all projections. /// /// Useful to test cycle detection. + #[derive(Default, Debug)] struct RotateProjectionRule { // reverse exprs instead of rotating on the first pass reverse_on_first_pass: Mutex, diff --git a/datafusion/optimizer/src/propagate_empty_relation.rs b/datafusion/optimizer/src/propagate_empty_relation.rs index 61d9934d897a..b5e1077ee5be 100644 --- a/datafusion/optimizer/src/propagate_empty_relation.rs +++ b/datafusion/optimizer/src/propagate_empty_relation.rs @@ -29,7 +29,7 @@ use crate::optimizer::ApplyOrder; use crate::{OptimizerConfig, OptimizerRule}; /// Optimization rule that bottom-up to eliminate plan by propagating empty_relation. -#[derive(Default)] +#[derive(Default, Debug)] pub struct PropagateEmptyRelation; impl PropagateEmptyRelation { diff --git a/datafusion/optimizer/src/push_down_filter.rs b/datafusion/optimizer/src/push_down_filter.rs index 6f0a64b85cb6..b34e95fd601c 100644 --- a/datafusion/optimizer/src/push_down_filter.rs +++ b/datafusion/optimizer/src/push_down_filter.rs @@ -130,7 +130,7 @@ use crate::{OptimizerConfig, OptimizerRule}; /// reaches a plan node that does not commute with that filter, it adds the /// filter to that place. When it passes through a projection, it re-writes the /// filter's expression taking into account that projection. -#[derive(Default)] +#[derive(Default, Debug)] pub struct PushDownFilter {} /// For a given JOIN type, determine whether each input of the join is preserved diff --git a/datafusion/optimizer/src/push_down_limit.rs b/datafusion/optimizer/src/push_down_limit.rs index ab7880213692..158c7592df51 100644 --- a/datafusion/optimizer/src/push_down_limit.rs +++ b/datafusion/optimizer/src/push_down_limit.rs @@ -31,7 +31,7 @@ use datafusion_expr::logical_plan::{Join, JoinType, Limit, LogicalPlan}; /// Optimization rule that tries to push down `LIMIT`. /// //. It will push down through projection, limits (taking the smaller limit) -#[derive(Default)] +#[derive(Default, Debug)] pub struct PushDownLimit {} impl PushDownLimit { diff --git a/datafusion/optimizer/src/replace_distinct_aggregate.rs b/datafusion/optimizer/src/replace_distinct_aggregate.rs index c887192f6370..c026130c426f 100644 --- a/datafusion/optimizer/src/replace_distinct_aggregate.rs +++ b/datafusion/optimizer/src/replace_distinct_aggregate.rs @@ -54,7 +54,7 @@ use datafusion_expr::{Aggregate, Distinct, DistinctOn, Expr, LogicalPlan}; /// ``` /// Optimizer that replaces logical [[Distinct]] with a logical [[Aggregate]] -#[derive(Default)] +#[derive(Default, Debug)] pub struct ReplaceDistinctWithAggregate {} impl ReplaceDistinctWithAggregate { diff --git a/datafusion/optimizer/src/rewrite_disjunctive_predicate.rs b/datafusion/optimizer/src/rewrite_disjunctive_predicate.rs index 897afda267dc..a6b633fdb8fe 100644 --- a/datafusion/optimizer/src/rewrite_disjunctive_predicate.rs +++ b/datafusion/optimizer/src/rewrite_disjunctive_predicate.rs @@ -122,7 +122,7 @@ use datafusion_expr::{Expr, LogicalPlan, Operator}; /// ) /// ``` /// -#[derive(Default)] +#[derive(Default, Debug)] pub struct RewriteDisjunctivePredicate; impl RewriteDisjunctivePredicate { diff --git a/datafusion/optimizer/src/scalar_subquery_to_join.rs b/datafusion/optimizer/src/scalar_subquery_to_join.rs index e5c8757405cf..6409bb9e03f7 100644 --- a/datafusion/optimizer/src/scalar_subquery_to_join.rs +++ b/datafusion/optimizer/src/scalar_subquery_to_join.rs @@ -36,7 +36,7 @@ use datafusion_expr::utils::conjunction; use datafusion_expr::{expr, EmptyRelation, Expr, LogicalPlan, LogicalPlanBuilder}; /// Optimizer rule for rewriting subquery filters to joins -#[derive(Default)] +#[derive(Default, Debug)] pub struct ScalarSubqueryToJoin {} impl ScalarSubqueryToJoin { diff --git a/datafusion/optimizer/src/simplify_expressions/simplify_exprs.rs b/datafusion/optimizer/src/simplify_expressions/simplify_exprs.rs index c4dba4c8df73..c0142ae0fc5a 100644 --- a/datafusion/optimizer/src/simplify_expressions/simplify_exprs.rs +++ b/datafusion/optimizer/src/simplify_expressions/simplify_exprs.rs @@ -45,7 +45,7 @@ use super::ExprSimplifier; /// `Filter: b > 2` /// /// [`Expr`]: datafusion_expr::Expr -#[derive(Default)] +#[derive(Default, Debug)] pub struct SimplifyExpressions {} impl OptimizerRule for SimplifyExpressions { diff --git a/datafusion/optimizer/src/single_distinct_to_groupby.rs b/datafusion/optimizer/src/single_distinct_to_groupby.rs index dd82b056d0a6..d0bc28c0f605 100644 --- a/datafusion/optimizer/src/single_distinct_to_groupby.rs +++ b/datafusion/optimizer/src/single_distinct_to_groupby.rs @@ -51,7 +51,7 @@ use hashbrown::HashSet; /// ) /// GROUP BY a /// ``` -#[derive(Default)] +#[derive(Default, Debug)] pub struct SingleDistinctToGroupBy {} const SINGLE_DISTINCT_ALIAS: &str = "alias1"; diff --git a/datafusion/optimizer/src/unwrap_cast_in_comparison.rs b/datafusion/optimizer/src/unwrap_cast_in_comparison.rs index 2118ae96a198..22e3c0ddd076 100644 --- a/datafusion/optimizer/src/unwrap_cast_in_comparison.rs +++ b/datafusion/optimizer/src/unwrap_cast_in_comparison.rs @@ -72,7 +72,7 @@ use datafusion_expr::{lit, Expr, ExprSchemable, LogicalPlan}; /// Filter: c1 > INT32(10) /// ``` /// -#[derive(Default)] +#[derive(Default, Debug)] pub struct UnwrapCastInComparison {} impl UnwrapCastInComparison {