From 90d0b526b33a5c385d4b7358322394a31d8bec7f Mon Sep 17 00:00:00 2001 From: Gunther Xing Date: Sun, 31 May 2026 14:10:24 +0000 Subject: [PATCH] docs: revise OptimizerRule trait method descriptions Updated the description of the `OptimizerRule` trait methods to reflect changes in the `try_optimize` and `rewrite` methods in `Working with `Expr`s` doc. --- docs/source/library-user-guide/working-with-exprs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/library-user-guide/working-with-exprs.md b/docs/source/library-user-guide/working-with-exprs.md index 472ab2481360e..2f15fa90610d9 100644 --- a/docs/source/library-user-guide/working-with-exprs.md +++ b/docs/source/library-user-guide/working-with-exprs.md @@ -167,7 +167,7 @@ In DataFusion, an `OptimizerRule` is a trait that supports rewriting `Expr`s tha We'll call our rule `AddOneInliner` and implement the `OptimizerRule` trait. The `OptimizerRule` trait has two methods: - `name` - returns the name of the rule -- `try_optimize` - takes a `LogicalPlan` and returns an `Option`. If the rule is able to optimize the plan, it returns `Some(LogicalPlan)` with the optimized plan. If the rule is not able to optimize the plan, it returns `None`. +- `rewrite` - takes a `LogicalPlan` and `&dyn OptimizerConfig`, and returns a `Result>`. If the rule is able to optimize the plan, it returns `Transformed::yes` with the optimized plan. If the rule is not able to optimize the plan, it returns `Transformed::no`. ```rust use std::sync::Arc;