-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Conversation
util/chunk/chunk.go
Outdated
@@ -347,6 +347,11 @@ type Row struct { | |||
idx int | |||
} | |||
|
|||
// ID returns the row index of Chunk. | |||
func (r Row) ID() 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.
I think we should use Idx
for consistency.
@zz-jason |
/run-all-tests |
expression/chunk_executor.go
Outdated
|
||
// 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) { |
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.
Our normal tests do not cover this, we should add a specific test case for it.
LGTM |
executor/executor.go
Outdated
chk.Reset() | ||
for { | ||
for ; e.inputRow != e.childrenResults[0].End(); e.inputRow = e.inputRow.Next() { | ||
if e.batched { |
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 think you can split batch and non-batch logic into two different function.
Keep the function small and compact make the code more readable.
/run-all-tests |
@tiancaiamao PTAL again |
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
executor/executor.go
Outdated
continue | ||
} | ||
chk.AppendRow(0, e.inputRow) | ||
if chk.NumRows() == e.ctx.GetSessionVars().MaxChunkSize { |
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.
- move this check to line 610 thus line 612 can be removed.
- chk.reachMaxSize()
executor/executor.go
Outdated
} | ||
} | ||
|
||
func (e *SelectionExec) unBatchedNextChunk(chk *chunk.Chunk) error { |
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.
add a comment for this func.
LGTM |
LGTM |
to #5261 |
No description provided.