amalsaidov commented on PR #20233: URL: https://github.com/apache/pinot/pull/20233#issuecomment-7035355933
Thanks for the thorough repro, that was a real problem. Reworked it: - `CorrelationTuple` now keeps `(count, meanX, meanY, m2X, m2Y, cXY)`, Welford per row and Chan merge, like `VarianceTuple`. Final result is `cXY / (sqrt(m2X) * sqrt(m2Y))`; the clamp now only covers ulp noise. - Wire type is `58`, with a CORR row in `IntermediateResultByteBufferSerDeTest`. - Doc fixed to "fewer than two rows"; a single row is now tested as undefined. - New test with a 1e9 offset / sd 10, n=100k (aggregate, group-by and a 4-way serialize + merge) and a +1e9 shift-invariance check, both against `PearsonsCorrelation`. They agree to ~5e-9, which is about what doubles allow with ~8 significant digits of spread; the test tolerance is 1e-7. `CorrelationAggregationFunctionTest`, `IntermediateResultByteBufferSerDeTest` and `AggregationFunctionNullContractTest` pass, and spotless/checkstyle/license are clean on pinot-core and pinot-segment-local. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
