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
util/chunk: add List to holds a slice of Chunk. #5290
Conversation
Used to properly handle max chunk size when appending row.
/rebuild |
) | ||
|
||
// List holds a slice of chunks, use to append rows with max chunk size properly handled. | ||
type List struct { |
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.
In what scenario should we use this ?
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.
Sort and TopN can use it to simplify the logic.
And the IndexLookUpJoin need it too because we need index batch size greater than max chunk size.
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 not use container/list
?
LGTM |
util/chunk/list_test.go
Outdated
} | ||
c.Assert(l.NumChunks(), check.Equals, 3) | ||
c.Assert(l.Len(), check.Equals, 5) | ||
|
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.
check len(l.freelist) == 0 here
rest 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
Used to properly handle max chunk size when appending row.