-
Notifications
You must be signed in to change notification settings - Fork 715
fix: rewrite match_all_raw fns to match_all #8399
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
Signed-off-by: Yashodhan Joshi <[email protected]>
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
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.
Greptile Summary
This PR introduces a backward compatibility layer for SQL queries in OpenObserve by adding a SQL rewriter that automatically transforms legacy function calls. The change adds a new module match_all_raw.rs that implements a visitor pattern to rewrite deprecated match_all_raw and match_all_raw_ignore_case function calls to the unified match_all function during SQL parsing.
The implementation follows the established architecture pattern in the codebase where SQL transformations are handled by dedicated visitor modules. The new MatchAllRawVisitor is integrated into the SQL processing pipeline at step 4, ensuring that deprecated function names are normalized before other SQL analysis and optimization steps. This allows existing user queries to continue working without modification while the system internally uses the standardized match_all function interface.
The change includes comprehensive test coverage for various SQL query patterns and maintains the same behavior as the original functions. All subsequent processing steps in the SQL pipeline have been renumbered accordingly (from steps 5-16 instead of 4-15) to accommodate the new transformation step.
Confidence score: 5/5
- This PR is safe to merge with minimal risk as it only adds backward compatibility without changing existing functionality
- Score reflects the non-breaking nature of the change, comprehensive test coverage, and adherence to established code patterns
- No files require special attention as the implementation is straightforward and follows existing architectural patterns
3 files reviewed, 1 comment
User description
This adds a sql re-writer which re-writes
match_all_rawandmatch_all_raw_ignore_caseto justmatch_allfor backward compatibility.PR Type
Bug fix, Tests
Description
Add SQL rewriter for
match_all_rawMap ignore-case variant to
match_allIntegrate visitor into SQL pipeline
Add unit tests for rewrites
Diagram Walkthrough
File Walkthrough
mod.rs
Integrate match_all_raw rewriter into SQL flowsrc/service/search/sql/mod.rs
MatchAllRawVisitormatch_all_raw*mod.rs
Register match_all_raw rewriter modulesrc/service/search/sql/rewriter/mod.rs
match_all_rawmodulematch_all_raw.rs
New visitor to rewrite match_all_raw variantssrc/service/search/sql/rewriter/match_all_raw.rs
MatchAllRawVisitorimplementingVisitorMutmatch_all_raw*function names tomatch_all