boyuanzz commented on a change in pull request #10972: [WIP] Add
DeduplicationByUniqueId transform
URL: https://github.com/apache/beam/pull/10972#discussion_r385979470
##########
File path: sdks/python/apache_beam/runners/portability/fn_api_runner_test.py
##########
@@ -543,6 +545,15 @@ def process(
self.assertEqual(1, len(counters))
self.assertEqual(counters[0].committed, len(''.join(data)))
+ def test_deduplication_by_id(self):
+ with self.create_pipeline() as p:
+ res = (p
+ | beam.Create([('id_1', 'value_1'),
+ ('id_2', 'value_2'),
+ ('id_1', 'value_1')])
+ | DeduplicationByUniqueId())
Review comment:
I think there is an assumption of using this transform: under any situation,
one unique id should map one specific value, for any 2 same unique id, the
value should also be the same. Thus we can deduplicate the value by this id.
One typical usage is reading from certain message queue, any message is paired
with one unified ID.
----------------------------------------------------------------
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]
With regards,
Apache Git Services