-
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
statistics: add tests for analyze
with dynamic partition prune mode
#23113
Conversation
honnef.co/go/tools v0.1.2 h1:SMdYLJl312RXuxXziCCHhRsp/tvct9cGKey0yv95tZM= | ||
honnef.co/go/tools v0.1.2/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= |
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.
Why do we change it?
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.
go mod tidy
changes it.
statistics/cmsketch.go
Outdated
finalTopN.TopN = make([]TopNMeta, 0, n) | ||
popedTopNPair := make([]TopNMeta, 0, uint32(numTop)-n) | ||
for value, cnt := range counter { | ||
data := hack.Slice(string(value)) | ||
if n > 0 && cnt >= lastTopCnt { | ||
if n > 0 && remain > 0 && cnt >= lastTopCnt { |
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 condition remain > 0
may make the result unstable when multiple items have the same lastTopCnt
.
Could we also update the sort algorithm above to make it stable?
@@ -1069,6 +1069,32 @@ func (s *testStatsSuite) TestMergeIdxHist(c *C) { | |||
c.Assert(len(rows.Rows()), Equals, 2) | |||
} | |||
|
|||
func (s *testStatsSuite) TestAnalyzeWithDynamicPartitionPruneMode(c *C) { |
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.
Test LGTM
/LGTM |
/LGTM |
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
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by writing |
/merge |
@Reminiscent: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger If you have any questions about the PR merge process, please refer to pr process. 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 ti-community-infra/tichi repository. |
This pull request has been accepted and is ready to merge. Commit hash: 9bf9857
|
@rebelice: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests 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 ti-community-infra/tichi repository. |
What problem does this PR solve?
analyze
with dynamic partition prune modetopN
Tests
Side effects
Release note