This is an automated email from the ASF dual-hosted git repository.

github-merge-queue[bot] pushed a commit to branch 
gh-readonly-queue/main/pr-22582-19c965315b5930e8f5d113d41e5ac26d06808750
in repository https://gitbox.apache.org/repos/asf/datafusion.git

commit dd0a05ee965c159e41be50a300e9342434dbcb27
Author: Gunther Xing <[email protected]>
AuthorDate: Thu Jun 4 19:29:53 2026 +0800

    docs: revise OptimizerRule trait method descriptions (#22582)
    
    Updated the description of the `OptimizerRule` trait methods to reflect
    changes in the `try_optimize` and `rewrite` methods in `Working with
    `Expr`s` doc.
    
    ## Which issue does this PR close?
    
    <!--
    We generally require a GitHub issue to be filed for all bug fixes and
    enhancements and this helps us generate change logs for our releases.
    You can link an issue to this PR using the GitHub syntax. For example
    `Closes #123` indicates that this PR will close issue #123.
    -->
    
    - Closes N/A
    
    ## Rationale for this change
    
    <!--
    Why are you proposing this change? If this is already explained clearly
    in the issue then this section is not needed.
    Explaining clearly why changes are proposed helps reviewers understand
    your changes and offer better suggestions for fixes.
    -->
    
    ## What changes are included in this PR?
    
    <!--
    There is no need to duplicate the description in the issue here but it
    is sometimes worth providing a summary of the individual changes in this
    PR.
    -->
    
    ## Are these changes tested?
    
    <!--
    We typically require tests for all PRs in order to:
    1. Prevent the code from being accidentally broken by subsequent changes
    2. Serve as another way to document the expected behavior of the code
    
    If tests are not included in your PR, please explain why (for example,
    are they covered by existing tests)?
    -->
    
    ## Are there any user-facing changes?
    
    <!--
    If there are user-facing changes then we may require documentation to be
    updated before approving the PR.
    -->
    
    <!--
    If there are any breaking changes to public APIs, please add the `api
    change` label.
    -->
---
 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 472ab24813..2f15fa9061 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<LogicalPlan>`. 
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<Transformed<LogicalPlan>>`. 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;


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to