Update comments on OptimizerRule about function name matching#20346
Open
alamb wants to merge 2 commits intoapache:mainfrom
Open
Update comments on OptimizerRule about function name matching#20346alamb wants to merge 2 commits intoapache:mainfrom
alamb wants to merge 2 commits intoapache:mainfrom
Conversation
2137f99 to
6071a18
Compare
neilconway
approved these changes
Feb 13, 2026
| /// DataFusion. | ||
| /// | ||
| /// For example if a rule rewrites a function based on the check | ||
| /// `func.name() == 'sum'`, if rewrite the plan incorrectly if the |
| /// | ||
| /// # Notes for implementations: | ||
| /// | ||
| /// # Return the same plan if no changes were made |
| /// | ||
| /// ## Matching on functions | ||
| /// | ||
| /// The rule should avoid function specific transformations, and instead use |
alamb
commented
Feb 13, 2026
Contributor
Author
alamb
left a comment
There was a problem hiding this comment.
Thanks @neilconway -- I did the changes in 6759858
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Rationale for this change
I gave feedback to @devanshu0987 https://github.com/apache/datafusion/pull/20180/changes#r2800720037 that it was not a good idea to check for function names in optimizer rules, but then I realized that the rationale for this is not written down anywhere.
What changes are included in this PR?
Document why checking for function names in optimizer rules is not good and offer alternatives
Are these changes tested?
By CI
Are there any user-facing changes?
Just docs, no functional changes