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

Add STDEV() aggregate function #1553

Merged
merged 14 commits into from
Nov 13, 2024
Merged

Conversation

ullingerc
Copy link
Collaborator

@ullingerc ullingerc commented Oct 14, 2024

Add a new aggregate function STDEV(X) which computes the (sample) standard deviation, such that a user will not have to repetitively type math:sqrt(sum(math:pow((X - avg(X)), 2)) / (count(*) - 1)). This is not part of the SPARQL standard, but also doesn't cause any conflicts.

Copy link

codecov bot commented Oct 14, 2024

Codecov Report

Attention: Patch coverage is 90.27778% with 7 lines in your changes missing coverage. Please review.

Project coverage is 89.22%. Comparing base (1bcfeeb) to head (428aa29).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/engine/sparqlExpressions/StdevExpression.cpp 91.48% 0 Missing and 4 partials ⚠️
src/engine/sparqlExpressions/StdevExpression.h 86.95% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1553   +/-   ##
=======================================
  Coverage   89.21%   89.22%           
=======================================
  Files         372      374    +2     
  Lines       34723    34795   +72     
  Branches     3915     3921    +6     
=======================================
+ Hits        30979    31046   +67     
- Misses       2471     2472    +1     
- Partials     1273     1277    +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@joka921 joka921 left a comment

Choose a reason for hiding this comment

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

An initial round of reviews.

src/engine/sparqlExpressions/StdevExpression.h Outdated Show resolved Hide resolved
src/engine/sparqlExpressions/StdevExpression.h Outdated Show resolved Hide resolved
src/engine/GroupBy.cpp Outdated Show resolved Hide resolved
src/engine/sparqlExpressions/StdevExpression.h Outdated Show resolved Hide resolved
@ullingerc ullingerc marked this pull request as ready for review November 4, 2024 14:27
Copy link
Member

@joka921 joka921 left a comment

Choose a reason for hiding this comment

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

Some very small suggestions.

src/engine/GroupBy.h Outdated Show resolved Hide resolved
src/engine/sparqlExpressions/StdevExpression.h Outdated Show resolved Hide resolved
test/SparqlAntlrParserTest.cpp Outdated Show resolved Hide resolved
Copy link
Member

@joka921 joka921 left a comment

Choose a reason for hiding this comment

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

A very last tiny request for the changes.

test/SparqlAntlrParserTest.cpp Outdated Show resolved Hide resolved
@sparql-conformance
Copy link

Copy link
Member

@joka921 joka921 left a comment

Choose a reason for hiding this comment

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

Thank you very much.
I will let the checks run once again, and then we can merge this.

Copy link

sonarcloud bot commented Nov 12, 2024

@joka921 joka921 merged commit 1a2fe17 into ad-freiburg:master Nov 13, 2024
22 checks passed
@hannahbast
Copy link
Member

@ullingerc @joka921

Thank you for this, it's a really useful shortcut!

There were quite a few complaints from SonarCloud, please have another quick look whether any of these should be addressed.

@ullingerc
Copy link
Collaborator Author

@hannahbast We have undone the merge and reopened this PR as #1614. I will address the Sonarcloud problems there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants