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

*: Refactoring reading logic of virtual generate column #12407

Merged
merged 41 commits into from
Nov 13, 2019

Conversation

wjhuang2016
Copy link
Member

@wjhuang2016 wjhuang2016 commented Sep 26, 2019

What problem does this PR solve?

Refactoring reading logic of virtual generate column, and Fix #5189.
After this pr, index on virtual column can be used.

What is changed and how it works?

  1. Compute the virtual column in tableReaderExecutor's Next() function, so that we can treat virtual column as ordinary column in planner. To do that, we need to expand virtual column with its dependent column so that TiKV will return sufficient data to compute virtual column.
  2. Reject ppd and agg function with virtual column to TiKV. For agg function, we reject it directly. For ppd, we first push the conditions to copTask, if copTask is a indexScan and virtual column is indexed, we can accept the ppd, otherwise we need to add a physicalSelection in rootTask.

Check List

Tests

  • Integration test
    The new tests are added on tidb_test/mysql_test

Code changes

  • Has exported function/method change
  • Has exported variable/fields change

Side effects

  • Increased code complexity
  • Breaking backward compatibility

Related changes

Release note

  • Refactoring reading logic of virtual generate column

@zyxbest
Copy link

zyxbest commented Sep 26, 2019

/run-unit-test

@codecov
Copy link

codecov bot commented Sep 26, 2019

Codecov Report

Merging #12407 into master will increase coverage by 0.6818%.
The diff coverage is n/a.

@@               Coverage Diff                @@
##             master     #12407        +/-   ##
================================================
+ Coverage   80.1577%   80.8396%   +0.6818%     
================================================
  Files           471        471                
  Lines        113571     116699      +3128     
================================================
+ Hits          91036      94339      +3303     
+ Misses        15440      15292       -148     
+ Partials       7095       7068        -27

@wjhuang2016 wjhuang2016 added sig/planner SIG: Planner status/WIP and removed sig/planner SIG: Planner labels Sep 26, 2019
@wjhuang2016
Copy link
Member Author

This pr depends on other pr for mysql_test which still WIP

@wjhuang2016
Copy link
Member Author

/rebuild

@wjhuang2016 wjhuang2016 marked this pull request as ready for review October 10, 2019 07:17
@wjhuang2016 wjhuang2016 added status/LGT3 The PR has already had 3 LGTM. and removed status/LGT2 Indicates that a PR has LGTM 2. labels Nov 1, 2019
Deardrops
Deardrops previously approved these changes Nov 1, 2019
Copy link
Contributor

@Deardrops Deardrops left a comment

Choose a reason for hiding this comment

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

LGTM

@wjhuang2016
Copy link
Member Author

Wait for tidb_test PR 915

@sre-bot
Copy link
Contributor

sre-bot commented Nov 3, 2019

@winoros, @Deardrops, @lamxTyler, @eurekaka, @bb7133, PTAL.

@wjhuang2016
Copy link
Member Author

/run-all-tests tidb-test=pr/915

1 similar comment
@wjhuang2016
Copy link
Member Author

/run-all-tests tidb-test=pr/915

@sre-bot
Copy link
Contributor

sre-bot commented Nov 7, 2019

@winoros, @Deardrops, @lamxTyler, @eurekaka, @bb7133, PTAL.

2 similar comments
@sre-bot
Copy link
Contributor

sre-bot commented Nov 9, 2019

@winoros, @Deardrops, @lamxTyler, @eurekaka, @bb7133, PTAL.

@sre-bot
Copy link
Contributor

sre-bot commented Nov 12, 2019

@winoros, @Deardrops, @lamxTyler, @eurekaka, @bb7133, PTAL.

@zz-jason zz-jason added the status/can-merge Indicates a PR has been approved by a committer. label Nov 12, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Nov 12, 2019

Your auto merge job has been accepted, waiting for 13385

@zz-jason zz-jason removed the status/can-merge Indicates a PR has been approved by a committer. label Nov 12, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Nov 12, 2019

/run-all-tests

@Deardrops
Copy link
Contributor

/run-all-tests tidb-test=pr/915

@wjhuang2016
Copy link
Member Author

/run-all-tests tidb-test=pr/915

Copy link
Contributor

@Deardrops Deardrops left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/expression sig/execution SIG execution sig/planner SIG: Planner status/LGT3 The PR has already had 3 LGTM.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support add index for a virtual generated column
8 participants