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
importer: generate int data by histogram #5795
Conversation
cmd/importer/main.go
Outdated
for _, idxInfo := range table.tblInfo.Indices { | ||
offset := idxInfo.Columns[0].Offset | ||
if hist, ok := statsInfo.Indices[idxInfo.ID]; ok { | ||
log.Warnf("index offset %d", offset) |
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 log warning?
cmd/importer/stats.go
Outdated
index *model.IndexInfo | ||
} | ||
|
||
func (h *histogram) getRandomBoundIdx() int { |
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.
Please add comments about the difference between odd and even index.
@coocood PTAL |
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.
rest LGTM
// When the cnt falls in the middle of bucket, we return the idx of lower bound which is an even number. | ||
// When the cnt falls in the end of bucket, we return the upper bound which is odd. | ||
func (h *histogram) getRandomBoundIdx() int { | ||
cnt := h.Buckets[len(h.Buckets)-1].Count |
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.
is that possible len(h.Buckets) = 0 ? this may cause panic
@WangXiangUSTC fixed by checking len of buckets after decoding stats file. PTAL |
LGTM |
pending to support more types.