-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
bindinfo: extract the table hint from the union statement #50070
Conversation
Signed-off-by: Weizhen Wang <[email protected]>
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #50070 +/- ##
=================================================
+ Coverage 71.9162% 82.0227% +10.1064%
=================================================
Files 1439 2444 +1005
Lines 346158 674601 +328443
=================================================
+ Hits 248944 553326 +304382
- Misses 76967 100559 +23592
- Partials 20247 20716 +469
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Signed-off-by: Weizhen Wang <[email protected]>
Signed-off-by: Weizhen Wang <[email protected]>
Signed-off-by: Weizhen Wang <[email protected]>
Signed-off-by: Weizhen Wang <[email protected]>
@@ -88,6 +88,18 @@ func ExtractTableHintsFromStmtNode(node ast.Node, sctx sessionctx.Context) []*as | |||
// check duplicated hints | |||
checkInsertStmtHintDuplicated(node, sctx) | |||
return x.TableHints | |||
case *ast.SetOprStmt: | |||
var result []*ast.TableOptimizerHint |
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.
Do we need to preallocate here? Might it not be worth it because usually we only have a few hints?
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.
It‘s hard to know how much memory do we need to allocate.
BTW, Many statements are without hint so preallocate is unnecessary.
return nil | ||
} | ||
for _, s := range x.SelectList.Selects { | ||
tmp := ExtractTableHintsFromStmtNode(s, sctx) |
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.
Maybe we can call it hints?
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: AilinKid, elsa0520, hi-rustin, qw4990 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <[email protected]>
In response to a cherrypick label: new pull request created to branch |
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <[email protected]>
What problem does this PR solve?
Issue Number: close #50068
Problem Summary:
What changed and how does it work?
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.