Hannah-Jiang commented on a change in pull request #12756:
URL: https://github.com/apache/beam/pull/12756#discussion_r485276327
##########
File path: sdks/python/apache_beam/transforms/stats_test.py
##########
@@ -41,13 +40,15 @@
from apache_beam.transforms.display import DisplayData
from apache_beam.transforms.display_test import DisplayDataItemMatcher
from apache_beam.transforms.stats import ApproximateQuantilesCombineFn
+from apache_beam.transforms.stats import ApproximateUniqueCombineFn
class ApproximateUniqueTest(unittest.TestCase):
- """Unit tests for ApproximateUnique.Globally and ApproximateUnique.PerKey.
- Hash() with Python3 is nondeterministic, so Approximation algorithm generates
- different result each time and sometimes error rate is out of range, so add
- retries for all tests who actually running approximation algorithm."""
+ """Unit tests for ApproximateUnique.Globally, ApproximateUnique.PerKey,
+ and ApproximateUniqueCombineFn.
Review comment:
Here is a background of mmh3 in case it helps for decision making. I
used mmh3 at first but decided to use default hash function. mmh3 has better
prediction performance, but it introduces much more complexity for dataflow
import, and users should use HLL if they really care about the accuracy. In
addition, the default hash function improved for Py3 and the performance diff
was not big enough to use mmh3 and introduce the complexity. This is the reason
mmh3 was not used, and it is just for reference.
I think it’s better to mention that HLL is supported by Beam.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]