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

Adds BatchSelectionExecutor #4562

Merged
merged 15 commits into from
Apr 26, 2019
Merged

Conversation

breezewish
Copy link
Member

@breezewish breezewish commented Apr 24, 2019

What have you changed? (mandatory)

This PR adds BatchSelectionExecutor.

Extracted from #3898

What are the type of the changes? (mandatory)

  • New feature (change which adds functionality)

How has this PR been tested? (mandatory)

Unit test

breezewish and others added 5 commits April 24, 2019 15:27
Signed-off-by: Breezewish <breezewish@pingcap.com>
Signed-off-by: Breezewish <breezewish@pingcap.com>
Signed-off-by: Breezewish <breezewish@pingcap.com>
@breezewish
Copy link
Member Author

/rebuild

rows_len,
self.src.schema(),
&mut src_result.data,
head_retain_map.as_mut_slice(),
Copy link
Member

Choose a reason for hiding this comment

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

It seems we needn't evaluate the left conditions once we meet a false in a row/

Copy link
Member Author

@breezewish breezewish Apr 24, 2019

Choose a reason for hiding this comment

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

There is a todo for this. More specifically, currently we cannot partially evaluate a column (i.e. only evaluates the cell which remains true in previous filter rounds).

// The selection executor should always return empty rows.

let r = exec.next_batch(1);
assert_eq!(r.data.rows_len(), 0);
Copy link
Member

Choose a reason for hiding this comment

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

Could we use a loop to avoid the repeated code?

Copy link
Member Author

Choose a reason for hiding this comment

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

it only repeats for the first 2 call. The third call is different (is_drained == true).


// The selection executor should return data as it is.

let r = exec.next_batch(1);
Copy link
Member

Choose a reason for hiding this comment

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

Maybe compare with which src_exec.next_batch returns will be more clear?

Copy link
Member Author

Choose a reason for hiding this comment

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

I wanted to do this, but the result is not cloneable, which makes it impossible to compare.

/// modification.
///
/// Normally this should be only used in tests.
pub struct MockExecutor {
Copy link
Member

Choose a reason for hiding this comment

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

Could we move it to the mod test?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think the name "MockExecutor" already clearly indicates that it is a test facility so that it doesn't need to be "test::MockExecutor".

src/coprocessor/dag/builder.rs Outdated Show resolved Hide resolved
Signed-off-by: Breezewish <breezewish@pingcap.com>
Signed-off-by: Breezewish <breezewish@pingcap.com>
@breezewish
Copy link
Member Author

/run-integration-tests

AndreMouche
AndreMouche previously approved these changes Apr 25, 2019
Copy link
Member

@AndreMouche AndreMouche left a comment

Choose a reason for hiding this comment

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

LGTM

@Connor1996 Connor1996 added the sig/coprocessor SIG: Coprocessor label Apr 25, 2019
Signed-off-by: Breezewish <breezewish@pingcap.com>
@breezewish breezewish force-pushed the ___batch_extract/t5/3 branch from 831cef8 to 0831527 Compare April 25, 2019 03:44
@breezewish
Copy link
Member Author

/run-integration-tests

@breezewish
Copy link
Member Author

/rebuild

AndreMouche
AndreMouche previously approved these changes Apr 25, 2019
rleungx
rleungx previously approved these changes Apr 25, 2019
@breezewish
Copy link
Member Author

/rebuild

@breezewish breezewish dismissed stale reviews from rleungx and AndreMouche via 6089047 April 26, 2019 02:36
Signed-off-by: Breezewish <breezewish@pingcap.com>
@breezewish breezewish force-pushed the ___batch_extract/t5/3 branch from 6089047 to ab8e11b Compare April 26, 2019 02:59
@breezewish
Copy link
Member Author

/rebuild

@breezewish
Copy link
Member Author

/run-integration-tests

1 similar comment
@AndreMouche
Copy link
Member

/run-integration-tests

@AndreMouche
Copy link
Member

/rebuild

@zhouqiang-cl
Copy link
Contributor

/run-integration-tests

@zhouqiang-cl
Copy link
Contributor

/test

@mahjonp
Copy link
Contributor

mahjonp commented Apr 26, 2019

/run-all-tests

@breezewish breezewish merged commit 7cf147f into tikv:master Apr 26, 2019
@breezewish breezewish deleted the ___batch_extract/t5/3 branch April 26, 2019 13:11
jswh pushed a commit to jswh/tikv that referenced this pull request May 27, 2019
Signed-off-by: Breezewish <breezewish@pingcap.com>
sticnarf pushed a commit to sticnarf/tikv that referenced this pull request Oct 27, 2019
Signed-off-by: Breezewish <breezewish@pingcap.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/coprocessor SIG: Coprocessor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants