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,distsql: refactor the base executor in tableReader #51397

Merged
merged 2 commits into from
Feb 29, 2024

Conversation

YangKeao
Copy link
Member

What problem does this PR solve?

Issue Number: close #51396

Problem Summary:

What changed and how does it work?

Create a new BaseExecutorV2 which doesn't contain session context, and use it to refactor the TableReaderExecutor.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.
      Should have been covered by existing tests, no logic change.

Release note

None

@ti-chi-bot ti-chi-bot bot added release-note-none size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Feb 28, 2024
Copy link

codecov bot commented Feb 28, 2024

Codecov Report

Merging #51397 (5527ff3) into master (1fc91d4) will increase coverage by 1.6096%.
The diff coverage is 61.0108%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #51397        +/-   ##
================================================
+ Coverage   70.6921%   72.3017%   +1.6096%     
================================================
  Files          1462       1462                
  Lines        435122     435179        +57     
================================================
+ Hits         307597     314642      +7045     
+ Misses       108229     100590      -7639     
- Partials      19296      19947       +651     
Flag Coverage Δ
integration 26.7304% <61.0108%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 53.9957% <ø> (ø)
parser ∅ <ø> (∅)
br 51.4263% <ø> (+5.5689%) ⬆️

@@ -3997,7 +3999,7 @@ func (b *executorBuilder) buildIndexMergeReader(v *plannercore.PhysicalIndexMerg
// 1. dataReaderBuilder calculate data range from argument, rather than plan.
// 2. the result executor is already opened.
type dataReaderBuilder struct {
plannercore.Plan
plan plannercore.Plan
Copy link
Member Author

Choose a reason for hiding this comment

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

As IndexLookUpExecutor embeded the dataReaderBuilder directly, it shouldn't embed Plan to avoid calling the ID of the Plan unexpectedly.

@YangKeao YangKeao force-pushed the refactor-base-executor-1 branch 3 times, most recently from 745fd5a to bada270 Compare February 28, 2024 11:22
// GetSessionVars gets the session variables.
GetSessionVars() *variable.SessionVars
// GetClient gets a kv.Client.
GetClient() kv.Client
Copy link
Member Author

@YangKeao YangKeao Feb 29, 2024

Choose a reason for hiding this comment

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

It's possible to remove GetClient() from the session context. It's only used in executor and distsql, but I'm not sure whether it's appropriate (or whether it's helpful). Therefore, I kept it, and the distsql context doesn't need *Extend.

Copy link

ti-chi-bot bot commented Feb 29, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-02-29 06:39:14.586187337 +0000 UTC m=+1116843.333810444: ☑️ agreed by lcwangchao.
  • 2024-02-29 08:46:13.193880942 +0000 UTC m=+1124461.941504054: ☑️ agreed by SeaRise.

@SeaRise
Copy link
Contributor

SeaRise commented Feb 29, 2024

/hold

@ti-chi-bot ti-chi-bot bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 29, 2024
@SeaRise
Copy link
Contributor

SeaRise commented Feb 29, 2024

comment /unhold to merge pr

Copy link
Contributor

@zanmato1984 zanmato1984 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

ti-chi-bot bot commented Feb 29, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lcwangchao, SeaRise, tangenta, zanmato1984

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added the approved label Feb 29, 2024
Signed-off-by: Yang Keao <yangkeao@chunibyo.icu>
Signed-off-by: Yang Keao <yangkeao@chunibyo.icu>
@YangKeao
Copy link
Member Author

/unhold

@ti-chi-bot ti-chi-bot bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 29, 2024
@YangKeao
Copy link
Member Author

/retest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor the BaseExecutor in TableReaderExecutor.
5 participants