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 #1614

Merged
merged 27 commits into from
Nov 14, 2024
Merged

Conversation

ullingerc
Copy link
Collaborator

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.

@ullingerc ullingerc requested a review from joka921 November 13, 2024 09:35
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.

Two small suggestions.

src/engine/sparqlExpressions/StdevExpression.cpp Outdated Show resolved Hide resolved
src/engine/sparqlExpressions/StdevExpression.cpp Outdated Show resolved Hide resolved
@sparql-conformance
Copy link

Copy link

codecov bot commented Nov 13, 2024

Codecov Report

Attention: Patch coverage is 95.87629% with 8 lines in your changes missing coverage. Please review.

Project coverage is 89.26%. Comparing base (1bcfeeb) to head (92b1051).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
src/engine/sparqlExpressions/StdevExpression.cpp 91.83% 0 Missing and 4 partials ⚠️
src/engine/sparqlExpressions/StdevExpression.h 86.95% 3 Missing ⚠️
src/engine/CartesianProductJoin.cpp 99.16% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1614      +/-   ##
==========================================
+ Coverage   89.21%   89.26%   +0.04%     
==========================================
  Files         372      374       +2     
  Lines       34723    34892     +169     
  Branches     3915     3937      +22     
==========================================
+ Hits        30979    31146     +167     
- Misses       2471     2472       +1     
- Partials     1273     1274       +1     

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

Copy link

sonarqubecloud bot commented Nov 13, 2024

Quality Gate Passed Quality Gate passed

Issues
2 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

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 for these final fixes.

@joka921 joka921 merged commit b0a1d1e into ad-freiburg:master Nov 14, 2024
22 checks passed
realHannes pushed a commit to realHannes/qlever that referenced this pull request Nov 15, 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.
@ullingerc ullingerc deleted the aggregate-stdev branch November 15, 2024 13:44
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.

2 participants