-
Notifications
You must be signed in to change notification settings - Fork 84
refactor(clp-s): Simplify dictionary search for variable string predicates. #1112
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
refactor(clp-s): Simplify dictionary search for variable string predicates. #1112
Conversation
WalkthroughThe changes update the wildcard variable string search logic in Changes
Sequence Diagram(s)sequenceDiagram
participant QueryRunner
participant VarDictionary
QueryRunner->>VarDictionary: get_entries_matching_wildcard_string(query_string)
VarDictionary-->>QueryRunner: matching_var_ids
QueryRunner->>QueryRunner: Insert matching_var_ids into matching_vars set
Possibly related PRs
Suggested reviewers
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Cppcheck (2.17.1)components/core/src/clp_s/search/QueryRunner.cpp/bin/bash: line 1: /usr/bin/cppcheck: No such file or directory components/core/tests/test-clp_s-search.cpp/bin/bash: line 1: /usr/bin/cppcheck: No such file or directory 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🧰 Additional context used📓 Path-based instructions (1)**/*.{cpp,hpp,java,js,jsx,tpp,ts,tsx}Instructions used from: Sources: 🧠 Learnings (4)📓 Common learningscomponents/core/tests/test_log_files/test_search.jsonl (1)components/core/tests/test-clp_s-search.cpp (5)components/core/src/clp_s/search/QueryRunner.cpp (3)🔇 Additional comments (4)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Looks reasonable. The only nitpick might be that new empty line but I think it's actually better to keep it in the change.
Did some simple unit-testing to convince myself that the change works
kirkrodrigues
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.
Deferring to @haiqi96's review.
Description
The existing clp-s code strangely handles search for variable strings containing wildcards by populating a
SubQueryusingEncodedVariableInterpreter::wildcard_search_dictionary_and_get_encoded_matchesand checking the precise and imprecise variables in the resultingSubQueryto populate the set of matching variables for the predicate.This PR simplifies this logic by directly using the
VariableDictionary::get_entries_matching_wildcard_stringmember function and populating the set of matching variables directly based on the return value.We also add some tests that exercise the wildcard and non-wildcard search paths for variable strings.
Checklist
breaking change.
Validation performed
Summary by CodeRabbit
New Features
Tests