You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2020/12/07 16:55:01 UTC

[GitHub] [beam] pabloem commented on a change in pull request #13490: Avoiding queries that check whether a BQ table is empty for streaming inserts

pabloem commented on a change in pull request #13490:
URL: https://github.com/apache/beam/pull/13490#discussion_r537664459



##########
File path: sdks/python/apache_beam/io/gcp/bigquery_tools.py
##########
@@ -924,7 +924,8 @@ def get_or_create_table(
 
     # If table exists already then handle the semantics for WRITE_EMPTY and
     # WRITE_TRUNCATE write dispositions.
-    if found_table:
+    if found_table and write_disposition in (
+        BigQueryDisposition.WRITE_EMPTY, BigQueryDisposition.WRITE_TRUNCATE):
       table_empty = self._is_table_empty(project_id, dataset_id, table_id)

Review comment:
       good catch. LMK if it looks better now.




----------------------------------------------------------------
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:
users@infra.apache.org