| 538 | }; |
| 539 | |
| 540 | void AggregateFunctions::CorrInit(FunctionContext* ctx, StringVal* dst) { |
| 541 | dst->is_null = false; |
| 542 | dst->len = sizeof(CorrState); |
| 543 | AllocBuffer(ctx, dst, dst->len); |
| 544 | if (UNLIKELY(dst->is_null)) { |
| 545 | DCHECK(!ctx->impl()->state()->GetQueryStatus().ok()); |
| 546 | return; |
| 547 | } |
| 548 | *(reinterpret_cast<CorrState*>(dst->ptr)) = {}; |
| 549 | } |
| 550 | |
| 551 | static inline void CorrUpdateState(double x, double y, CorrState* state) { |
| 552 | double deltaX = x - state->xavg; |
nothing calls this directly
no test coverage detected