-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix](search) add restriction for search function #56706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds restrictions for the search() function to ensure it can only be used in WHERE clauses on single-table OLAP scans. The implementation includes validation rules that reject search() usage in other contexts like SELECT projections, GROUP BY clauses, HAVING clauses, and multi-table scenarios.
- Added a new analysis rule
CheckSearchUsagethat validates search() function usage patterns - Created comprehensive unit tests covering valid and invalid search() usage scenarios
- Integrated the validation rule into the analyzer pipeline before other optimizations
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| CheckSearchUsage.java | Main validation rule that checks search() usage restrictions recursively through the plan tree |
| CheckSearchUsageTest.java | Comprehensive unit tests covering valid WHERE clause usage and invalid usage in projections, GROUP BY, joins, etc. |
| RuleType.java | Added CHECK_SEARCH_USAGE rule type enum |
| Analyzer.java | Integrated CheckSearchUsage rule into analyzer pipeline |
| test_search_usage_restrictions.out | Test output file for regression tests |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/CheckSearchUsage.java
Outdated
Show resolved
Hide resolved
fe/fe-core/src/test/java/org/apache/doris/nereids/rules/analysis/CheckSearchUsageTest.java
Outdated
Show resolved
Hide resolved
fe/fe-core/src/test/java/org/apache/doris/nereids/rules/analysis/CheckSearchUsageTest.java
Show resolved
Hide resolved
|
run buildall |
ClickBench: Total hot run time: 30.25 s |
FE UT Coverage ReportIncrement line coverage |
FE Regression Coverage ReportIncrement line coverage |
1 similar comment
FE Regression Coverage ReportIncrement line coverage |
HappenLee
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
PR approved by at least one committer and no changes requested. |
1 similar comment
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
1 similar comment
|
PR approved by anyone and no changes requested. |
### What problem does this PR solve? Issue Number: close #xxx Related PR: #56139 Problem Summary: This PR adds restrictions for the search() function to ensure it can only be used in WHERE clauses on single-table OLAP scans. The implementation includes validation rules that reject search() usage in other contexts like SELECT projections, GROUP BY clauses, HAVING clauses, and multi-table scenarios.
### What problem does this PR solve? Issue Number: close #xxx Related PR: apache#56139 Problem Summary: This PR adds restrictions for the search() function to ensure it can only be used in WHERE clauses on single-table OLAP scans. The implementation includes validation rules that reject search() usage in other contexts like SELECT projections, GROUP BY clauses, HAVING clauses, and multi-table scenarios.
What problem does this PR solve?
Issue Number: close #xxx
Related PR: #56139
Problem Summary:
This PR adds restrictions for the search() function to ensure it can only be used in WHERE clauses on single-table OLAP scans. The implementation includes validation rules that reject search() usage in other contexts like SELECT projections, GROUP BY clauses, HAVING clauses, and multi-table scenarios.
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)