Uh oh!
There was an error while loading. Please reload this page.
Update comments on OptimizerRule about function name matching - #20346
Conversation
2137f99 to
6071a18CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
alamb
left a comment
There was a problem hiding this comment.
Thanks @neilconway -- I did the changes in 6759858
2010YOUY01
left a comment
There was a problem hiding this comment.
Thank you for the doc. I believe this is a pretty important detail to know!
| /// ## Matching on functions | ||
| /// | ||
| /// The rule should avoid function-specific transformations, and instead use | ||
| /// methods on [`ScalarUDFImpl`] and [`AggregateUDFImpl`]. Specifically, the |
There was a problem hiding this comment.
I remember there are still several cases that rely on function name checking, where it is not possible to implement the optimization using methods on ScalarUDFImpl.
We have a tracking issue, should we link it here? #18643
## Which issue does this PR close? - Similarly to #20346 ## Rationale for this change As part of PR reviews, it seems like it is not obvious to some contributors that there is a non trivial cost to adding new optimizer rules. Let's add that knowledge into the codebase as comments, so it may be less of a surprise ## What changes are included in this PR? Add comments ## Are these changes tested? N/A ## Are there any user-facing changes? No this is entirely internal comments oly --------- Co-authored-by: Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
…20348) ## Which issue does this PR close? - Similarly to apache#20346 ## Rationale for this change As part of PR reviews, it seems like it is not obvious to some contributors that there is a non trivial cost to adding new optimizer rules. Let's add that knowledge into the codebase as comments, so it may be less of a surprise ## What changes are included in this PR? Add comments ## Are these changes tested? N/A ## Are there any user-facing changes? No this is entirely internal comments oly --------- Co-authored-by: Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com>
…#20346) ## Which issue does this PR close? - Related to apache#20180 ## Rationale for this change I gave feedback to @devanshu0987https://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
Which issue does this PR close?
Rationale for this change
I gave feedback to @devanshu0987https://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