-
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
Conversation
ee5ef89 to
79301c4
Compare
79301c4 to
c93696a
Compare
…ion. Falling back to pickling for key grouping was never safe, and should not have been recommended.
c93696a to
98cc71f
Compare
|
R: @udim |
4b9fb15 to
64adb6a
Compare
42458d8 to
fd87993
Compare
| 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I can tell, parse_table_reference is used to normalize and populate TableReference instances. They are essentially a "(project, dataset, table) tuple."
It should be possible to beam.Map(lambda x: (x.tableId, x.datasetId, x.projectId)) | beam.Distinct() | beam.Map(lambda x: parse_table_reference(*x))
cc: @pabloem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming exactly these three fields would not be as future proof.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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.
https://googleapis.dev/python/bigquery/latest/generated/google.cloud.bigquery.table.TableReference.html
robertwb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, PTAL.
| 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming exactly these three fields would not be as future proof.
|
Run Python_PVR_Flink PreCommit |
|
I seem to be bumping into an error caused by deterministic coder enforcement. Do you mind taking a look at ##14112? |
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
R: @username).[BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replaceBEAM-XXXwith the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.CHANGES.mdwith noteworthy changes.See the Contributor Guide for more tips on how to make review process smoother.
Post-Commit Tests Status (on master branch)
Pre-Commit Tests Status (on master branch)
See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.
GitHub Actions Tests Status (on master branch)
See CI.md for more information about GitHub Actions CI.