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

[feature] runningDifference function #1787

Closed
BohuTANG opened this issue Sep 10, 2021 · 2 comments · Fixed by #1961
Closed

[feature] runningDifference function #1787

BohuTANG opened this issue Sep 10, 2021 · 2 comments · Fixed by #1961
Assignees
Labels
C-feature Category: feature community-take good first issue Category: good first issue

Comments

@BohuTANG
Copy link
Member

Summary

Calculates the difference between successive row values ​​in the data block.

Like a table repo_stars:

date stars
2021-09-10 1035
2021-09-09 1021
2021-09-08 1000
SELECT date, runningDifference(start) as delta FROM repo_stars
date delta
2021-09-10 14
2021-09-09 21
2021-09-08 0
@BohuTANG BohuTANG added C-feature Category: feature good first issue Category: good first issue labels Sep 10, 2021
@ygf11
Copy link
Contributor

ygf11 commented Sep 13, 2021

/assignme

@ygf11
Copy link
Contributor

ygf11 commented Sep 19, 2021

It seems runningDifference function should consider null value condition, and the behavior in clickhouse looks like:

  1. if row[i] is null, then the result is null.
  2. if row[i] is not null, and row[i-1] is null, then the result is 0.

is this the expected logic?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature Category: feature community-take good first issue Category: good first issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants