Skip to content

planner, executor: supports select statement with AS OF#24613

Merged
ti-chi-bot merged 44 commits into
pingcap:masterfrom
nolouch:stale-select
May 27, 2021
Merged

planner, executor: supports select statement with AS OF#24613
ti-chi-bot merged 44 commits into
pingcap:masterfrom
nolouch:stale-select

Conversation

@nolouch
Copy link
Copy Markdown
Member

@nolouch nolouch commented May 13, 2021

Signed-off-by: nolouch nolouch@gmail.com

What problem does this PR solve?

Ref: #24557
Problem Summary:

Implement the syntax Select .... FROM xxx AS OF timestamp xxx with stale read.

What is changed and how it works?

the planner should visit the as of clause and extract the tso.

Check List

Tests

  • Unit test
  • Integration test

Release note

  • make select statements support stale read

Signed-off-by: nolouch <nolouch@gmail.com>
@ti-chi-bot ti-chi-bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 13, 2021
@nolouch nolouch changed the title planner, exector: supports select statement with AS OF planner, executor: supports select statement with AS OF May 13, 2021
@github-actions github-actions Bot added sig/execution SIG execution sig/planner SIG: Planner labels May 13, 2021
Signed-off-by: nolouch <nolouch@gmail.com>
Comment thread planner/core/logical_plan_builder.go Outdated
Comment thread planner/core/logical_plan_builder.go Outdated
Comment thread planner/core/logical_plan_builder.go Outdated
nolouch added 2 commits May 14, 2021 00:41
Signed-off-by: nolouch <nolouch@gmail.com>
Signed-off-by: nolouch <nolouch@gmail.com>
@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 13, 2021
@ti-chi-bot ti-chi-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 16, 2021
@nolouch nolouch marked this pull request as ready for review May 16, 2021 21:50
@nolouch nolouch requested review from a team as code owners May 16, 2021 21:50
@nolouch nolouch requested review from XuHuaiyu and removed request for a team May 16, 2021 21:50
@ti-chi-bot ti-chi-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 16, 2021
nolouch added 3 commits May 17, 2021 05:52
Signed-off-by: nolouch <nolouch@gmail.com>
Signed-off-by: nolouch <nolouch@gmail.com>
@nolouch
Copy link
Copy Markdown
Member Author

nolouch commented May 17, 2021

Comment thread planner/optimize.go Outdated
Comment thread planner/core/logical_plan_builder.go Outdated
Comment thread planner/core/logical_plan_builder.go Outdated
Copy link
Copy Markdown
Contributor

@xhebox xhebox left a comment

Choose a reason for hiding this comment

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

LGTM, expect that I am not sure if handles nested select stmt well. I doubt that it needs to be recursively called.

Comment thread executor/stale_txn_test.go Outdated
Comment thread executor/stale_txn_test.go Outdated
Comment thread executor/stale_txn_test.go Outdated
Comment thread planner/core/logical_plan_builder.go Outdated
Comment thread planner/core/logical_plan_builder.go Outdated
Comment thread planner/optimize.go Outdated
Signed-off-by: nolouch <nolouch@gmail.com>
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label May 26, 2021
@nolouch
Copy link
Copy Markdown
Member Author

nolouch commented May 26, 2021

/run-all-tests

@purelind
Copy link
Copy Markdown
Contributor

/run-unit-test

@purelind
Copy link
Copy Markdown
Contributor

/run-sqllogic-test

@ti-chi-bot
Copy link
Copy Markdown
Member

@JmPotato: Thanks for your review. The bot only counts /lgtm from reviewers and higher roles in list, but you're still welcome to leave your comments.

Details

In response to this:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

Comment thread planner/optimize.go
Comment thread planner/core/errors.go
Comment thread planner/core/common_plans.go Outdated
Comment thread executor/prepared.go
@ti-chi-bot
Copy link
Copy Markdown
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • Yisaer
  • winoros

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

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

Details

Reviewer can indicate their review by writing /lgtm in a comment.
Reviewer can cancel approval by writing /lgtm cancel in a comment.

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels May 27, 2021
@winoros
Copy link
Copy Markdown
Member

winoros commented May 27, 2021

/merge

@ti-chi-bot
Copy link
Copy Markdown
Member

This pull request has been accepted and is ready to merge.

DetailsCommit hash: c7a8a96

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label May 27, 2021
@ti-chi-bot
Copy link
Copy Markdown
Member

/run-all-tests

This bot automatically retries jobs that failed on can merge PRs (send feedback to hi-rustin).

Silence the bot with the /merge cancel comment for consistent failures.

@ti-chi-bot
Copy link
Copy Markdown
Member

@nolouch: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@ti-chi-bot
Copy link
Copy Markdown
Member

/run-all-tests

This bot automatically retries jobs that failed on can merge PRs (send feedback to hi-rustin).

Silence the bot with the /merge cancel comment for consistent failures.

@nolouch
Copy link
Copy Markdown
Member Author

nolouch commented May 27, 2021

/merge

@ti-chi-bot
Copy link
Copy Markdown
Member

@nolouch: /merge is only allowed for the committers, you can assign this pull request to the committer in list by filling /assign @committer in the comment to help merge this pull request.

Details

In response to this:

/merge

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@ti-chi-bot ti-chi-bot merged commit f3557bb into pingcap:master May 27, 2021
@nolouch nolouch deleted the stale-select branch May 27, 2021 13:12
// to fix, Table 'test.ttt' doesn't exist
_ = Preprocess(s.ctx, stmt, s.is)
err = Preprocess(s.ctx, stmt, WithPreprocessorReturn(&PreprocessorReturn{InfoSchema: s.is}))
builder, _ := NewPlanBuilder(MockContext(), s.is, &hint.BlockHintProcessor{})
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You forgot to check err here.
Try run make check before every commit.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Actually, errcheck will ignore test files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/expression component/statistics sig/execution SIG execution sig/planner SIG: Planner sig/sql-infra SIG: SQL Infra size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants