[
https://issues.apache.org/jira/browse/BEAM-10824?focusedWorklogId=478985&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-478985
]
ASF GitHub Bot logged work on BEAM-10824:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 04/Sep/20 07:58
Start Date: 04/Sep/20 07:58
Worklog Time Spent: 10m
Work Description: Hannah-Jiang commented on a change in pull request
#12756:
URL: https://github.com/apache/beam/pull/12756#discussion_r483452975
##########
File path: sdks/python/apache_beam/transforms/stats_test.py
##########
@@ -160,57 +159,13 @@ def test_get_sample_size_from_est_error(self):
assert beam.ApproximateUnique._get_sample_size_from_est_error(0.05) == 1600
assert beam.ApproximateUnique._get_sample_size_from_est_error(0.01) ==
40000
- @unittest.skip(
- 'Skip it because hash function is not good enough. '
- 'TODO: BEAM-7654')
def test_approximate_unique_global_by_sample_size(self):
# test if estimation error with a given sample size is not greater than
# expected max error.
sample_size = 16
max_err = 2 / math.sqrt(sample_size)
- test_input = [
- 4,
- 34,
- 29,
- 46,
- 80,
- 66,
- 51,
- 81,
- 31,
- 9,
- 26,
- 36,
- 10,
- 41,
- 90,
- 35,
- 33,
- 19,
- 88,
- 86,
- 28,
- 93,
- 38,
- 76,
- 15,
- 87,
- 12,
- 39,
- 84,
- 13,
- 32,
- 49,
- 65,
- 100,
- 16,
- 27,
- 23,
- 30,
- 96,
- 54
- ]
-
+ test_input = list(range(100))
Review comment:
It’s better to run at least 100 times to test flakiness. I’d recommend
to run 1000 times.
----------------------------------------------------------------
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 478985)
Remaining Estimate: 15h (was: 15h 10m)
Time Spent: 9h (was: 8h 50m)
> Hash in stats.ApproximateUniqueCombineFn NON-deterministic
> ----------------------------------------------------------
>
> Key: BEAM-10824
> URL: https://issues.apache.org/jira/browse/BEAM-10824
> Project: Beam
> Issue Type: Bug
> Components: sdk-py-core
> Reporter: Monica Song
> Priority: P1
> Labels: hash
> Original Estimate: 24h
> Time Spent: 9h
> Remaining Estimate: 15h
>
> The python hash() function is non-deterministic. As a result, different
> workers will map identical values to different hashes. This leads to
> overestimation of the number of unique values (by several magnitudes, in my
> experience x1000) in a distributed processing model.
> [https://github.com/apache/beam/blob/master/sdks/python/apache_beam/transforms/stats.py#L218]
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)