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
merged 4 commits into from Mar 6, 2019

Conversation

@lamxTyler
Copy link
Member

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

Tests

  • 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

@zz-jason
Copy link
Member

zz-jason left a comment

LGTM

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

@lamxTyler

This comment has been minimized.

Copy link
Member Author

lamxTyler commented Mar 4, 2019

/run-all-tests

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

@winoros

winoros approved these changes Mar 6, 2019

Copy link
Member

winoros left a comment

lgtm

@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
Details
ci/circleci Your tests passed on CircleCI!
Details
idc-jenkins-ci-tidb/build Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/check_dev Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
Details

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.