planner: warn view-style hints on CTE references#68426
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR adds warning logic to handle view-style ChangesCTE QB_NAME Hint Warning
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #68426 +/- ##
================================================
- Coverage 77.2764% 76.4999% -0.7766%
================================================
Files 2010 1992 -18
Lines 555481 557555 +2074
================================================
- Hits 429256 426529 -2727
- Misses 125305 130982 +5677
+ Partials 920 44 -876
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
/retest |
What problem does this PR solve?
Issue Number: close #64570
Problem Summary:
View-style optimizer hints that target a CTE reference can be collected before name resolution, but the CTE builder path does not consume the forwarded view hints. As a result, some hints are silently dropped and only the
qb_namehint may be reported as unused.What changed and how does it work?
This PR detects view-style
QB_NAMEhints when a table name resolves to a CTE reference. If the first hinted table matches the CTE reference in the current query block, the forwarded table hints are reported as ignored due to an unknown query block name.The hint is still not applied to the CTE body. This keeps the existing plan behavior unchanged while making the warning surface consistent.
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.
Summary by CodeRabbit
Tests
Bug Fixes