Skip to content

[BEAM-11884] Pass destination as str rather than TableReference within BigQueryBatchFileLoads - #14112

Merged
pabloem merged 1 commit into
apache:masterfrom
chunyang:cyang/hashable-dest
Mar 8, 2021
Merged

[BEAM-11884] Pass destination as str rather than TableReference within BigQueryBatchFileLoads#14112
pabloem merged 1 commit into
apache:masterfrom
chunyang:cyang/hashable-dest

Conversation

@chunyang

@chunyangchunyang commented Feb 27, 2021

Copy link
Copy Markdown
Contributor

I encountered the following error that appears to be caused by #13839

TypeError: Unable to deterministically encode '<TableReference
datasetId: 'my-dataset-id'
projectId: 'my-project-id'
tableId: 'my-table-id'>' of type '<class 'apache_beam.io.gcp.internal.clients.bigquery.bigquery_v2_messages.TableReference'>', please provide a type hint for the input of 'WriteToBigQuery/BigQueryBatchFileLoads/GroupFilesByTableDestinations' [while running 'WriteToBigQuery/BigQueryBatchFileLoads/IdentityWorkaround']

The outputs of WriteRecordsToFile, WriteGroupedRecordsToFile, and TriggerLoadJobs can contain TableReference which does not have a deterministic coder. The PR uses bigquery_tools.get_hashable_destination to create a string representation of TableReference so that it can be deterministically coded and used with GroupByKey.


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Choose reviewer(s) and mention them in a comment (R: @username).
  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

Post-Commit Tests Status (on master branch)

LangSDKDataflowFlinkSamzaSparkTwister2
GoBuild Status---Build Status---Build Status---
JavaBuild StatusBuild Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build StatusBuild Status
Build Status
Build Status
Build Status
PythonBuild Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
---Build Status---
XLangBuild StatusBuild StatusBuild Status---Build Status---

Pre-Commit Tests Status (on master branch)

---JavaPythonGoWebsiteWhitespaceTypescript
Non-portableBuild StatusBuild Status
Build Status
Build Status
Build Status
Build StatusBuild StatusBuild StatusBuild Status
Portable---Build Status------------

See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests

See CI.md for more information about GitHub Actions CI.

@chunyang

Copy link
Copy Markdown
ContributorAuthor

R: @robertwb
R: @udim

@codecov

codecovBot commented Feb 27, 2021

Copy link
Copy Markdown

Codecov Report

Merging #14112 (9d3a354) into master (07e1e02) will increase coverage by 0.03%.
The diff coverage is n/a.

Impacted file tree graph

@@ Coverage Diff @@## master #14112 +/- ##
==========================================
+ Coverage 83.01% 83.04% +0.03% 
==========================================
Files 469 469 Lines 58355 58466 +111 ==========================================
+ Hits 48443 48555 +112 + Misses 9912 9911 -1 
Impacted FilesCoverage Δ
...eam/runners/portability/fn_api_runner/fn_runner.py
...ython/apache_beam/examples/kafkataxi/kafka_taxi.py
...ld/srcs/sdks/python/apache_beam/coders/__init__.py
...examples/snippets/transforms/elementwise/filter.py
...ild/srcs/sdks/python/apache_beam/io/gcp/dicomio.py
...s/sdks/python/apache_beam/testing/test_pipeline.py
...apache_beam/portability/api/beam_runner_api_pb2.py
...s/sdks/python/apache_beam/io/gcp/bigquery_tools.py
...srcs/sdks/python/apache_beam/typehints/__init__.py
...s/python/apache_beam/typehints/sharded_key_type.py
... and 928 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 07e1e02...9d3a354. Read the comment docs.

@pabloem

Copy link
Copy Markdown
Member

thanks!

@chunyang
chunyang deleted the cyang/hashable-dest branch March 8, 2021 23:26
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@chunyang@pabloem