-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[YAML] Add Partition transform. #30368
Conversation
Assigning reviewers. If you would like to opt out of this review, comment R: @liferoad for label python. Available commands:
The PR bot will only process comments in the main thread (not review comments). |
R: @Polber |
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control |
Unfortunately this parses in yaml as True :(.
I mostly object to calling a Split transform, when it's doing what we've termed largely as Partitioning in beam. Splitting as a Beam concept is generally around Bundles (and increasing Processing Parallelism within a PCollection). It does us no good to muddy the definitions. So why is it not being called Partition? |
I'm all for trying to find better names for this. I thought about Partition, but Beam already has a Partition operation that's a bit different: it takes in a integer N and splits the PCollection into N numbered PCollections: https://beam.apache.org/documentation/programming-guide/#partition My other hesitation is that partition is used like shard (and roughly) parallelism of otherwise homogenous datasets in other systems like Kafka. But that's not a blocker. I really haven't settled on naming that I like here (and went back and forth when writing this). Maybe we should bikeshed on the dev list. |
I'd say while partitions are inherently numerically based, that's largely an implementation detail to serve the user goal of "turn 1 PCollection into N PCollections, known at Pipeline Construction Time". Personally I'd say that the "standard" beam one is just a "PartitionByIndex", vs a general "PartitionBy" transform that this appears to be. I have no objection to devlist bikeshedding though. |
After thinking about this some more, you've convinced my Partition is the way to go. Updated. |
Now that the naming is settled, is there anything else that needs to be addressed? |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #30368 +/- ##
==========================================
- Coverage 71.46% 71.44% -0.02%
==========================================
Files 710 710
Lines 104795 104835 +40
==========================================
+ Hits 74887 74903 +16
- Misses 28277 28301 +24
Partials 1631 1631
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@robertwb I have the two pending comments above, namely renaming |
Ah, good catch. Done. |
Co-authored-by: Jeff Kinard <jeff@thekinards.com>
This allows one to split a single PCollection into multiple distinct PCollections based on some property of the elements.
It performs the role of (numeric) partition and side outputs from other languages.
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
addresses #123
), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, commentfixes #<ISSUE NUMBER>
instead.CHANGES.md
with noteworthy changes.See the Contributor Guide for more tips on how to make review process smoother.
To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md
GitHub Actions Tests Status (on master branch)
See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.