-
Notifications
You must be signed in to change notification settings - Fork 4.5k
[BEAM-11719 ] Use deterministic coders for grouping keys. #13839
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
Changes from all commits
fd61359
8141e45
98cc71f
64adb6a
fd87993
10abd33
8f0b056
1318fbd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,6 +32,7 @@ | |
|
|
||
| import hashlib | ||
| import logging | ||
| import pickle | ||
| import random | ||
| import uuid | ||
|
|
||
|
|
@@ -858,9 +859,13 @@ def _load_data( | |
| lambda x, | ||
| deleting_tables: deleting_tables, | ||
| pvalue.AsIter(temp_tables_pc)) | ||
| | "RemoveTempTables/AddUselessValue" >> beam.Map(lambda x: (x, None)) | ||
| # TableReference has no deterministic coder, but as this de-duplication | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From what I can tell, cc: @pabloem
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Assuming exactly these three fields would not be as future proof.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ack. The official BigQuery client (which this code doesn't use) has a hashable wrapper for this. |
||
| # is best-effort, pickling should be good enough. | ||
| | "RemoveTempTables/AddUselessValue" >> | ||
| beam.Map(lambda x: (pickle.dumps(x), None)) | ||
| | "RemoveTempTables/DeduplicateTables" >> beam.GroupByKey() | ||
| | "RemoveTempTables/GetTableNames" >> beam.Map(lambda elm: elm[0]) | ||
| | "RemoveTempTables/GetTableNames" >> | ||
| beam.MapTuple(lambda k, nones: pickle.loads(k)) | ||
| | "RemoveTempTables/Delete" >> beam.ParDo( | ||
| DeleteTablesFn(self.test_client))) | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.