Skip to content

Commit

Permalink
fix(fuzzer): Allow large error with global aggregation of approx_dist…
Browse files Browse the repository at this point in the history
…inct (#12323)

Summary:
Pull Request resolved: #12323

The approx_distinct function only guarantees the standard deviation of error distribution when there is a large number of groups. With global aggregation, it should be allowed if approx_distinct produces a large error. This diff relaxes the ApproxDistinctResultVerifier to allow large errors with global aggregations.

Reviewed By: Yuhta

Differential Revision: D69611305

fbshipit-source-id: 589ada873404156fd45b14bb048b2bfd7ef95415
  • Loading branch information
kagamiori authored and facebook-github-bot committed Feb 13, 2025
1 parent 8524313 commit 0d0a815
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class ApproxDistinctResultVerifier : public ResultVerifier {
return largeGaps.size() <= 3;
}

return largeGaps.empty();
return numGroups == 1 || largeGaps.empty();
}

// For approx_distinct in window operations, input sets for rows in the same
Expand Down

0 comments on commit 0d0a815

Please sign in to comment.