[
https://issues.apache.org/jira/browse/BEAM-13080?focusedWorklogId=677949&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-677949
]
ASF GitHub Bot logged work on BEAM-13080:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 05/Nov/21 23:30
Start Date: 05/Nov/21 23:30
Worklog Time Spent: 10m
Work Description: apilloud commented on a change in pull request #15912:
URL: https://github.com/apache/beam/pull/15912#discussion_r744024480
##########
File path: sdks/python/apache_beam/transforms/util.py
##########
@@ -725,7 +725,7 @@ class Reshuffle(PTransform):
"""
# We use 32-bit integer as the default number of buckets.
- _DEFAULT_NUM_BUCKETS = 1 << 32
+ _DEFAULT_NUM_BUCKETS = (1 << 32) - 1
Review comment:
From a chat discussion, I think either of these are equivalent:
`randint(0, (1 << 32) - 2)` or `randrange(0, (1 << 32)-1)`
`randint(0, (1 << 32) - 2)` -> `randrange(0, (1 << 32)-1)` ->
`_randbelow((1<<32)-1)` -> `getrandbits(32)`
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 677949)
Time Spent: 4h 50m (was: 4h 40m)
> Specify numBuckets in Python Reshuffle
> --------------------------------------
>
> Key: BEAM-13080
> URL: https://issues.apache.org/jira/browse/BEAM-13080
> Project: Beam
> Issue Type: New Feature
> Components: sdk-py-core
> Reporter: Inigo San Jose Visiers
> Priority: P2
> Time Spent: 4h 50m
> Remaining Estimate: 0h
>
> While Java has `withNumBuckets` to set the amount of generated keys, Python
> doesn't.
> This is particularly need when your input data is not so high and you need to
> take advantage for DoFn methods `start / finish bundle`.
> https://beam.apache.org/releases/javadoc/2.33.0/org/apache/beam/sdk/transforms/Reshuffle.ViaRandomKey.html#withNumBuckets-java.lang.Integer-
--
This message was sent by Atlassian Jira
(v8.3.4#803005)