[
https://issues.apache.org/jira/browse/BEAM-10824?focusedWorklogId=478738&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-478738
]
ASF GitHub Bot logged work on BEAM-10824:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 03/Sep/20 18:08
Start Date: 03/Sep/20 18:08
Worklog Time Spent: 10m
Work Description: tvalentyn commented on a change in pull request #12756:
URL: https://github.com/apache/beam/pull/12756#discussion_r483158065
##########
File path: sdks/python/apache_beam/transforms/stats.py
##########
@@ -192,7 +193,7 @@ def get_estimate(self):
if len(self._sample_heap) < self._sample_size:
return len(self._sample_heap)
else:
- sample_space_size = sys.maxsize - 1.0 * self._min_hash
+ sample_space_size = self._HASH_SPACE_SIZE - 1.0 * self._min_hash
Review comment:
Ah, that was because python's `hash()` can return negative values. So
yes, I think we need to set `self._min_hash = 2**64` given that now all hash
values are positive.
----------------------------------------------------------------
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: 478738)
Remaining Estimate: 17h 40m (was: 17h 50m)
Time Spent: 6h 20m (was: 6h 10m)
> 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: 6h 20m
> Remaining Estimate: 17h 40m
>
> 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)