- 
  Notifications
 You must be signed in to change notification settings 
- Fork 285
add hint case #22665
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
add hint case #22665
Conversation
CLA assistant check 
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.
✅ Ariznawlll
❌ Ariznawl@163.com 
Ariznawl@163.com seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.
PR Compliance Guide 🔍
Below is a summary of compliance checks for this PR:
Malformed input handling
Description: The test suite embeds intentionally malformed JSON and SQL in hints, which is acceptable 
for testing but could be risky if such patterns were copied into production code; ensure 
the engine robustly validates and rejects these without executing partial inputs.
 hint.sql [389-401] 
Referred Code
/*+ { "rewrites": { "hint_test.users": "SELECT * FROM users" } */ select * from users; -- missing quotation marks /*+ { rewrites: { "hint_test.users": "SELECT * FROM users" } } */ select * from users;
🎫 #22466
rewrite rules.
map.
specified SELECTs.
or views only.
table does not exist.
no hidden recursion occurs beyond what tests cover.
Codebase context is not defined
Follow the guide to enable codebase context checks.
No custom compliance provided
Follow the guide to enable custom compliance check.
- Update
Compliance status legend
🟢 - Fully Compliant🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label
| PR Code Suggestions ✨Explore these optional code suggestions: 
 | |||||||||||||||
...lll/matrixone into add_case_view_defination
Uh oh!
There was an error while loading. Please reload this page.
User description
What type of PR is this?
Which issue(s) this PR fixes:
add hint case
issue #
#22466
What this PR does / why we need it:
add hint case
PR Type
Tests
Description
Add comprehensive test suite for hint rewriting functionality
Test basic single and multi-table rewrite rules with JSON hints
Test complex queries including aggregations, grouping, window functions
Test edge cases: empty rules, special characters, case sensitivity
Test error handling: invalid JSON, syntax errors, non-existent tables
Diagram Walkthrough
File Walkthrough
hint.sql
Comprehensive hint rewriting test suitetest/distributed/cases/hint/hint.sql
functionality
syntax
functions, subqueries, UNION
names, case sensitivity
table references, recursive detection
hint.result
Expected results for hint rewriting teststest/distributed/cases/hint/hint.result
functionality
queries
and non-existent tables
resolution