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: support window function first_value and last_value #9560

Merged
merged 2 commits into from
Mar 6, 2019

Conversation

alivxxx
Copy link
Contributor

@alivxxx alivxxx commented Mar 5, 2019

What problem does this PR solve?

Support window function first_value and last_value.
Refer https://dev.mysql.com/doc/refman/8.0/en/window-function-descriptions.html#function_first-value and https://dev.mysql.com/doc/refman/8.0/en/window-function-descriptions.html#function_last-value.

For #9499

What is changed and how it works?

  • Add one interface to handle the evaluation of expressions, it can be used by first_value, last_value, nth_value, lead and lag.
  • Implement the functions under the agg function interface.

Check List

Tests

  • Integration test

Code changes

  • Has exported function/method change

Side effects

  • None

Related changes

  • None

@alivxxx alivxxx added type/enhancement The issue or PR belongs to an enhancement. sig/execution SIG execution labels Mar 5, 2019
@alivxxx alivxxx mentioned this pull request Mar 5, 2019
11 tasks
@codecov-io
Copy link

codecov-io commented Mar 5, 2019

Codecov Report

Merging #9560 into master will decrease coverage by 0.1%.
The diff coverage is 0.64%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #9560      +/-   ##
=========================================
- Coverage   67.41%   67.3%   -0.11%     
=========================================
  Files         375     376       +1     
  Lines       78809   78963     +154     
=========================================
+ Hits        53126   53143      +17     
- Misses      20919   21057     +138     
+ Partials     4764    4763       -1
Impacted Files Coverage Δ
executor/aggfuncs/func_value.go 0% <0%> (ø)
executor/aggfuncs/builder.go 30.21% <0%> (-1.92%) ⬇️
expression/aggregation/base_func.go 48.2% <100%> (ø) ⬆️
executor/aggregate.go 79.11% <0%> (+0.21%) ⬆️
executor/distsql.go 72.18% <0%> (+0.45%) ⬆️
executor/join.go 79.58% <0%> (+0.51%) ⬆️
executor/index_lookup_join.go 78.05% <0%> (+0.62%) ⬆️
expression/schema.go 94.53% <0%> (+0.78%) ⬆️
executor/window.go 70.9% <0%> (+2.27%) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2b646cb...ffe851a. Read the comment docs.

Copy link
Member

@winoros winoros left a comment

Choose a reason for hiding this comment

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

lgtm

@winoros
Copy link
Member

winoros commented Mar 6, 2019

./run-all-tests

zz-jason
zz-jason previously approved these changes Mar 6, 2019
Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

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

LGTM

@alivxxx
Copy link
Contributor Author

alivxxx commented Mar 6, 2019

@zz-jason Resolved conflicts, please help approve again.

@zz-jason zz-jason merged commit 247777d into pingcap:master Mar 6, 2019
@alivxxx alivxxx deleted the values branch May 23, 2019 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/execution SIG execution status/LGT2 Indicates that a PR has LGTM 2. type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants