Skip to content
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: compute and store column order correlation with handle #9315

Merged
merged 7 commits into from
Feb 27, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
move extractSampleItemsDatums to _test.go
  • Loading branch information
eurekaka committed Feb 23, 2019
commit 2cc6b0543d68d93e6a23135b70c13a2f8ab4b222
11 changes: 11 additions & 0 deletions statistics/fmsketch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,19 @@ import (

. "github.com/pingcap/check"
"github.com/pingcap/tidb/sessionctx/stmtctx"
"github.com/pingcap/tidb/types"
)

// extractSampleItemsDatums is for test purpose only to extract Datum slice
// from SampleItem slice.
func extractSampleItemsDatums(items []*SampleItem) []types.Datum {
datums := make([]types.Datum, len(items))
for i, item := range items {
datums[i] = item.Value
}
return datums
}

func (s *testStatisticsSuite) TestSketch(c *C) {
sc := &stmtctx.StatementContext{TimeZone: time.Local}
maxSize := 1000
Expand Down
10 changes: 0 additions & 10 deletions statistics/sample.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,6 @@ func SortSampleItems(sc *stmtctx.StatementContext, items []*SampleItem) error {
return sorter.err
}

// extractSampleItemsDatums is for test purpose only to extract Datum slice
// from SampleItem slice.
func extractSampleItemsDatums(items []*SampleItem) []types.Datum {
datums := make([]types.Datum, len(items))
for i, item := range items {
datums[i] = item.Value
}
return datums
}

type sampleItemSorter struct {
items []*SampleItem
sc *stmtctx.StatementContext
Expand Down