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
executor: reorg codes for hashtable in HashJoinExec #11937
Merged
XuHuaiyu
merged 17 commits into
pingcap:master
from
SunRunAway:disk-join-issue11607-reorg
Sep 3, 2019
Merged
Changes from 15 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
6cf30e5
executor: reorg code for hashtable in HashJoinExec
SunRunAway f980b13
fix benchmark
SunRunAway 8387cb3
make a suitable maxEntrySliceLen, it's currently too large(8k) for OL…
SunRunAway 63a0c3f
add unit test for rowHashMap.
SunRunAway a086d7f
initialize the size of rowHashMap from the estimated row count.
SunRunAway f0e04d6
licence
SunRunAway 0f66252
add TODO
SunRunAway 8a5087b
fix benchmark
SunRunAway 8def643
statCountMinFactor
SunRunAway 8ae2de4
address comments
SunRunAway ef97c5f
remove the ambiguous return value hasNull in GetMatchedRows
SunRunAway 633143d
add comment for estCount
SunRunAway a3cafe8
address comments
SunRunAway b16e09b
fix
SunRunAway a18a423
fix
SunRunAway a5e1273
Merge branch 'master' into disk-join-issue11607-reorg
sre-bot 10b0a3e
Merge branch 'master' into disk-join-issue11607-reorg
sre-bot File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Copyright 2019 PingCAP, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package executor | ||
|
||
import ( | ||
. "github.com/pingcap/check" | ||
"github.com/pingcap/tidb/util/chunk" | ||
) | ||
|
||
func (s *pkgTestSuite) TestRowHashMap(c *C) { | ||
m := newRowHashMap(0) | ||
m.Put(1, chunk.RowPtr{ChkIdx: 1, RowIdx: 1}) | ||
c.Check(m.Get(1), DeepEquals, []chunk.RowPtr{{ChkIdx: 1, RowIdx: 1}}) | ||
|
||
rawData := map[uint64][]chunk.RowPtr{} | ||
for i := uint64(0); i < 10; i++ { | ||
for j := uint64(0); j < initialEntrySliceLen*i; j++ { | ||
rawData[i] = append(rawData[i], chunk.RowPtr{ChkIdx: uint32(i), RowIdx: uint32(j)}) | ||
} | ||
} | ||
m = newRowHashMap(0) | ||
// put all rawData into m vertically | ||
for j := uint64(0); j < initialEntrySliceLen*9; j++ { | ||
for i := 9; i >= 0; i-- { | ||
i := uint64(i) | ||
if !(j < initialEntrySliceLen*i) { | ||
break | ||
} | ||
m.Put(i, rawData[i][j]) | ||
} | ||
} | ||
// check | ||
totalCount := 0 | ||
for i := uint64(0); i < 10; i++ { | ||
totalCount += len(rawData[i]) | ||
c.Check(m.Get(i), DeepEquals, rawData[i]) | ||
} | ||
c.Check(m.Len(), Equals, totalCount) | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Should we record the
rowIdx
of whichhasNull
is true?If we use the outer table to build hashtable, we need to know the null-value lines.
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'll adjust it in further PR to involve
hashRowContainer
into index join.