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

executor: support Chunk for SelectionExec #5211

Merged
merged 20 commits into from
Nov 30, 2017

Conversation

zz-jason
Copy link
Member

No description provided.

@@ -347,6 +347,11 @@ type Row struct {
idx int
}

// ID returns the row index of Chunk.
func (r Row) ID() int {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should use Idx for consistency.

@coocood
Copy link
Member

coocood commented Nov 27, 2017

@zz-jason
Should consider vectorizable?

@zz-jason
Copy link
Member Author

/run-all-tests

@zz-jason zz-jason added this to the 1.1 milestone Nov 28, 2017
@zz-jason zz-jason mentioned this pull request Nov 29, 2017
41 tasks

// UnVectorizedFilter applys a list of filters to a Chunk and returns a bool slice, which indicates whether a row is passed the filters.
// Filters is not executed vectorized.
func UnVectorizedFilter(ctx context.Context, filters []Expression, input *chunk.Chunk, selected []bool) ([]bool, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our normal tests do not cover this, we should add a specific test case for it.

@coocood
Copy link
Member

coocood commented Nov 29, 2017

LGTM

@coocood coocood added the status/LGT1 Indicates that a PR has LGTM 1. label Nov 30, 2017
chk.Reset()
for {
for ; e.inputRow != e.childrenResults[0].End(); e.inputRow = e.inputRow.Next() {
if e.batched {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can split batch and non-batch logic into two different function.
Keep the function small and compact make the code more readable.

@zz-jason
Copy link
Member Author

/run-all-tests

@zz-jason
Copy link
Member Author

@tiancaiamao PTAL again

Copy link
Contributor

@XuHuaiyu XuHuaiyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rest LGTM

continue
}
chk.AppendRow(0, e.inputRow)
if chk.NumRows() == e.ctx.GetSessionVars().MaxChunkSize {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. move this check to line 610 thus line 612 can be removed.
  2. chk.reachMaxSize()

}
}

func (e *SelectionExec) unBatchedNextChunk(chk *chunk.Chunk) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a comment for this func.

@XuHuaiyu
Copy link
Contributor

LGTM
/run-all-tests

@XuHuaiyu XuHuaiyu added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Nov 30, 2017
@tiancaiamao
Copy link
Contributor

LGTM

@zz-jason
Copy link
Member Author

to #5261

@XuHuaiyu XuHuaiyu merged commit ba1979c into pingcap:master Nov 30, 2017
@zz-jason zz-jason deleted the dev/chunk/selection branch December 29, 2017 02:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants