Files
documentdb/pg_helio_api/sql/udfs/aggregation/window_aggregates--latest.sql
T
Xing Fan ⛳ ce4a709922 Merged PR 1412546: Window operators: $covariancePop & $covarianceSamp
### Does this PR have any customer impact?
No

### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Feature

### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
UDF

### Are you introducing any new config? If yes, do you have tests with and without them being set?
No

### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))

### Description
Implemented covariancePop & covarianceSamp for setWindowFields

----
#### AI description  (iteration 1)
#### PR Classification
Documentation

#### PR Summary
This pull request adds design documentation for the `$covariancePop` and `$covarianceSamp` aggregation operators.
- Added `covariancePop.md` detailing the specification, behavior, examples, implementation plan, and test plan for the `$covariancePop` operator.
- Added `covarianceSamp.md` detailing the specification, behavior, examples, implementation plan, and test plan for the `$covarianceSamp` operator.
2024-08-26 13:12:13 +03:00

26 lines
1.1 KiB
SQL

CREATE OR REPLACE AGGREGATE helio_api_internal.BSONCOVARIANCEPOP(__CORE_SCHEMA__.bson, __CORE_SCHEMA__.bson)
(
SFUNC = helio_api_internal.bson_covariance_pop_samp_transition,
FINALFUNC = helio_api_internal.bson_covariance_pop_final,
MSFUNC = helio_api_internal.bson_covariance_pop_samp_transition,
MFINALFUNC = helio_api_internal.bson_covariance_pop_final,
MINVFUNC = helio_api_internal.bson_covariance_pop_samp_invtransition,
stype = bytea,
mstype = bytea,
COMBINEFUNC = helio_api_internal.bson_covariance_pop_samp_combine,
PARALLEL = SAFE
);
CREATE OR REPLACE AGGREGATE helio_api_internal.BSONCOVARIANCESAMP(__CORE_SCHEMA__.bson, __CORE_SCHEMA__.bson)
(
SFUNC = helio_api_internal.bson_covariance_pop_samp_transition,
FINALFUNC = helio_api_internal.bson_covariance_samp_final,
MSFUNC = helio_api_internal.bson_covariance_pop_samp_transition,
MFINALFUNC = helio_api_internal.bson_covariance_samp_final,
MINVFUNC = helio_api_internal.bson_covariance_pop_samp_invtransition,
stype = bytea,
mstype = bytea,
COMBINEFUNC = helio_api_internal.bson_covariance_pop_samp_combine,
PARALLEL = SAFE
);