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

planner, executor: handle default frame for window functions #9544

merged 4 commits into from Mar 6, 2019


Copy link

lamxTyler commented Mar 4, 2019

What problem does this PR solve?

When there is no frame specification, we need to add default frames to the window.

What is changed and how it works?

  • When there is no frame specification and the function needs frame,

    • if it has order by clause, we will use RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW as default frame.
    • Otherwise, we will leave it as empty, which is the same as RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING.
  • For functions that cannot have frame but a frame specification presents, we will remove that frame and raise a note.

Check List


  • Unit test

Code changes

  • Has exported function/method change

Side effects

  • None

Related changes

  • None

@lamxTyler lamxTyler added this to In progress in window function via automation Mar 4, 2019

@lamxTyler lamxTyler requested review from zz-jason , qw4990 and winoros Mar 4, 2019

Show resolved Hide resolved expression/aggregation/window_func.go Outdated
Show resolved Hide resolved planner/core/explain.go

window function automation moved this from In progress to Reviewer approved Mar 4, 2019

Copy link

zz-jason left a comment


only one LGTM..

window function automation moved this from Reviewer approved to Needs review Mar 4, 2019

@zz-jason zz-jason added the status/LGT1 label Mar 4, 2019


This comment has been minimized.

Copy link
Member Author

lamxTyler commented Mar 4, 2019


window function automation moved this from Needs review to Reviewer approved Mar 6, 2019


winoros approved these changes Mar 6, 2019

Copy link

winoros left a comment


@lamxTyler lamxTyler merged commit 2b646cb into pingcap:master Mar 6, 2019

4 of 5 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
ci/circleci Your tests passed on CircleCI!
idc-jenkins-ci-tidb/build Jenkins job succeeded.
idc-jenkins-ci-tidb/check_dev Jenkins job succeeded.
license/cla Contributor License Agreement is signed.

window function automation moved this from Reviewer approved to Done Mar 6, 2019

@lamxTyler lamxTyler deleted the lamxTyler:frame branch Mar 6, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.