-
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
planner: fix planner can't error for union-all query when new-only-full-group-check is enabled #59212
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: AilinKid <[email protected]>
Hi @AilinKid. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
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.
and we'd better add one unit test about the fd derivation of the union.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #59212 +/- ##
================================================
+ Coverage 73.0514% 73.5530% +0.5016%
================================================
Files 1689 1689
Lines 467001 470425 +3424
================================================
+ Hits 341151 346012 +4861
+ Misses 104860 103244 -1616
- Partials 20990 21169 +179
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Signed-off-by: AilinKid <[email protected]>
Signed-off-by: AilinKid <[email protected]>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hawkingrei 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 |
[LGTM Timeline notifier]Timeline:
|
Signed-off-by: AilinKid <[email protected]>
Signed-off-by: arenatlx <[email protected]>
equivs := childFD.EquivalenceCols() | ||
isEquiv := false | ||
for _, equiv := range equivs { | ||
if equiv.Has(iID) && equiv.Has(jID) { | ||
isEquiv = true | ||
break | ||
} | ||
} |
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.
wrap here as an inplace iteration to avoid the allocation caused by EquivalenveCols
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.
i changed it to func AreColsEquiv which won't alloc any mem
Signed-off-by: arenatlx <[email protected]>
Signed-off-by: arenatlx <[email protected]>
// check the equivalency between children. | ||
for i := 0; i < p.Schema().Len(); i++ { | ||
for j := i + 1; j < p.Schema().Len(); j++ { | ||
// detect the equivalency between the i-th and j-th column. | ||
flag := true | ||
iID := int(p.schema.Columns[i].UniqueID) | ||
jID := int(p.schema.Columns[j].UniqueID) | ||
for _, childFD := range childFDs { | ||
// once we find the i-th and j-th column are not equivalent in one child, we can break the loop. | ||
if !childFD.AreColsEquiv(iID, jID) { | ||
flag = false | ||
break | ||
} | ||
} | ||
if flag { | ||
res.AddEquivalence(intset.NewFastIntSet(iID), intset.NewFastIntSet(jID)) | ||
} | ||
} | ||
} |
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.
The time complexity is o(n^2*count(fd from all children))
.
actually we can reduce it to o(count(fd from all children)
by just iterating the fd from child0 to see calc the intersection with other children
What problem does this PR solve?
Issue Number: close #59211
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.