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

ISSUE-1787: add running difference function #1961

Merged
merged 8 commits into from
Sep 30, 2021

Conversation

ygf11
Copy link
Contributor

@ygf11 ygf11 commented Sep 25, 2021

I hereby agree to the terms of the CLA available at: https://databend.rs/policies/cla/

Summary

Add runningDifference function.

Changelog

  • New Feature

Related Issues

Fixes #1787

Test Plan

Unit Tests

Stateless Tests

@databend-bot databend-bot added the pr-feature this PR introduces a new feature to the codebase label Sep 25, 2021
@databend-bot
Copy link
Member

Thanks for the contribution!
I have applied any labels matching special text in your PR Changelog.

Please review the labels and make any necessary changes.

@codecov-commenter
Copy link

codecov-commenter commented Sep 25, 2021

Codecov Report

Merging #1961 (594f2f7) into master (c6823b9) will increase coverage by 0%.
The diff coverage is 89%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #1961    +/-   ##
=======================================
  Coverage      68%     69%            
=======================================
  Files         639     652    +13     
  Lines       36180   36674   +494     
=======================================
+ Hits        24913   25311   +398     
- Misses      11267   11363    +96     
Impacted Files Coverage Δ
common/functions/src/scalars/function_factory.rs 100% <ø> (ø)
.../src/scalars/others/running_difference_function.rs 68% <68%> (ø)
common/functions/src/scalars/others/other.rs 85% <85%> (ø)
...scalars/others/running_difference_function_test.rs 99% <99%> (ø)
query/src/configs/config.rs 50% <0%> (-30%) ⬇️
common/datavalues/src/arrays/ops/to_values.rs 9% <0%> (-14%) ⬇️
query/src/datasources/table/csv/csv_table.rs 64% <0%> (-12%) ⬇️
common/datavalues/src/arrays/list/mod.rs 47% <0%> (-8%) ⬇️
common/base/src/uniq_id.rs 93% <0%> (-7%) ⬇️
query/src/datasources/table/null/null_table.rs 81% <0%> (-7%) ⬇️
... and 154 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 c6823b9...594f2f7. Read the comment docs.

@BohuTANG
Copy link
Member

/review @sundy-li

@databend-bot
Copy link
Member

Take the reviewer to sundy-li

insert into runing_difference_test values (1, 1, 1, 'a'),(3, 3, 3, 'b'),(5, 5, 5, 'c'),(10, 10, 10, 'd');

select a, runningDifference(a), b, runningDifference(b), c, runningDifference(c), runningDifference(10) from runing_difference_test;
select d, runningDifference(d) from runing_difference_test;
Copy link
Member

Choose a reason for hiding this comment

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

Here we can add an error hint to avoid the error info to *.result, like:

select d, runningDifference(d) from runing_difference_test; -- {ErrorCode 7}

};
}

run_difference_compute!(compute_i8, i8, Int16, i16);
Copy link
Member

Choose a reason for hiding this comment

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

What about float numbers?

@ygf11 ygf11 force-pushed the feat_runningDifference_function branch from 1e07140 to 8812ab8 Compare September 26, 2021 12:50
Copy link
Member

@sundy-li sundy-li left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @ygf11

@databend-bot
Copy link
Member

CI Passed
Reviewer Approved
Let's Merge

10 similar comments
@databend-bot
Copy link
Member

CI Passed
Reviewer Approved
Let's Merge

@databend-bot
Copy link
Member

CI Passed
Reviewer Approved
Let's Merge

@databend-bot
Copy link
Member

CI Passed
Reviewer Approved
Let's Merge

@databend-bot
Copy link
Member

CI Passed
Reviewer Approved
Let's Merge

@databend-bot
Copy link
Member

CI Passed
Reviewer Approved
Let's Merge

@databend-bot
Copy link
Member

CI Passed
Reviewer Approved
Let's Merge

@databend-bot
Copy link
Member

CI Passed
Reviewer Approved
Let's Merge

@databend-bot
Copy link
Member

CI Passed
Reviewer Approved
Let's Merge

@databend-bot
Copy link
Member

CI Passed
Reviewer Approved
Let's Merge

@databend-bot
Copy link
Member

CI Passed
Reviewer Approved
Let's Merge

@databend-bot
Copy link
Member

CI Passed
Reviewer Approved
Let's Merge

16 similar comments
@databend-bot
Copy link
Member

CI Passed
Reviewer Approved
Let's Merge

@databend-bot
Copy link
Member

CI Passed
Reviewer Approved
Let's Merge

@databend-bot
Copy link
Member

CI Passed
Reviewer Approved
Let's Merge

@databend-bot
Copy link
Member

CI Passed
Reviewer Approved
Let's Merge

@databend-bot
Copy link
Member

CI Passed
Reviewer Approved
Let's Merge

@databend-bot
Copy link
Member

CI Passed
Reviewer Approved
Let's Merge

@databend-bot
Copy link
Member

CI Passed
Reviewer Approved
Let's Merge

@databend-bot
Copy link
Member

CI Passed
Reviewer Approved
Let's Merge

@databend-bot
Copy link
Member

CI Passed
Reviewer Approved
Let's Merge

@databend-bot
Copy link
Member

CI Passed
Reviewer Approved
Let's Merge

@databend-bot
Copy link
Member

CI Passed
Reviewer Approved
Let's Merge

@databend-bot
Copy link
Member

CI Passed
Reviewer Approved
Let's Merge

@databend-bot
Copy link
Member

CI Passed
Reviewer Approved
Let's Merge

@databend-bot
Copy link
Member

CI Passed
Reviewer Approved
Let's Merge

@databend-bot
Copy link
Member

CI Passed
Reviewer Approved
Let's Merge

@databend-bot
Copy link
Member

CI Passed
Reviewer Approved
Let's Merge

@BohuTANG BohuTANG merged commit 3f9533a into databendlabs:master Sep 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-feature this PR introduces a new feature to the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature] runningDifference function
5 participants