From 836bb304ade9faf3b9f5deccc10bcc1d10af4392 Mon Sep 17 00:00:00 2001 From: Wei He Date: Tue, 9 Jul 2024 14:30:09 -0700 Subject: [PATCH] Fix ApproxDistinctResultVerifier for window fuzzer (#10424) Summary: Pull Request resolved: https://github.com/facebookincubator/velox/pull/10424 ApproxDistinctResultVerifier expects the number of groups with large errors to not exceed 5% of the number of all groups. The code currently instead hardcodes the bound to allow only 3 groups of large errors. This diff fixes the bound to be 5% * numGroups. The verification logic for aggregation fuzzer works fine so far, so this diff doesn't update the bound for aggregation fuzzer. Reviewed By: Yuhta Differential Revision: D59530860 fbshipit-source-id: ae9324bc72491a1a87e19893773088c654322890 --- velox/functions/prestosql/fuzzer/ApproxDistinctResultVerifier.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/velox/functions/prestosql/fuzzer/ApproxDistinctResultVerifier.h b/velox/functions/prestosql/fuzzer/ApproxDistinctResultVerifier.h index 32c48d84d226..a3a98379776e 100644 --- a/velox/functions/prestosql/fuzzer/ApproxDistinctResultVerifier.h +++ b/velox/functions/prestosql/fuzzer/ApproxDistinctResultVerifier.h @@ -228,7 +228,7 @@ class ApproxDistinctResultVerifier : public ResultVerifier { // We expect large deviations (>2 stddev) in < 5% of values. if (numGroups >= 50) { - return largeGaps.size() <= 3; + return largeGaps.size() <= 0.05 * numGroups; } return largeGaps.empty();