AnandInguva commented on code in PR #29542:
URL: https://github.com/apache/beam/pull/29542#discussion_r1409886383


##########
sdks/python/apache_beam/ml/transforms/handlers.py:
##########
@@ -134,7 +135,9 @@ def process(self, element):
         hash_object.update(str(list(value)).encode())
       else:  # assume value is a primitive that can be turned into str
         hash_object.update(str(value).encode())
-    yield (hash_object.hexdigest(), element)
+    # add a unique suffix to the hash key to avoid collisions.
+    unique_suffix = uuid.uuid4().hex

Review Comment:
   Thinking about this, we can just attach a unique id to each element. We just 
need unique id so that we can group transformed pcoll with untransformed pcoll 
with the downstream CoGroupByKey Pcoll



-- 
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]

Reply via email to