Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions sdks/python/apache_beam/io/gcp/bigquery_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,13 @@
"GEOGRAPHY": str,
}

# Duplicated logic with io/gcp/bigquery_change_history.py
# Default table expiration for auto-created temp datasets: 24 hours in ms.
# Tables created in the dataset auto-expire after this duration if not
# explicitly deleted, acting as a safety net for orphaned temp tables
# (e.g. pipeline crash before cleanup runs).
_DEFAULT_TABLE_EXPIRATION_MS = 24 * 60 * 60 * 1000

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't there a genuine data loss concern if there is a long running job that some temp tables are materialized, and expired before all of them finalized to destination table?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't encountered a load/export job that takes longer than a day. But I guess it's possible. A 7-day expiration window would be safer


Comment thread
aebrahim marked this conversation as resolved.

class FileFormat(object):
CSV = 'CSV'
Expand Down Expand Up @@ -952,6 +959,7 @@ def create_temporary_dataset(
project_id,
self.temp_dataset_id,
location=location,
default_table_expiration_ms=_DEFAULT_TABLE_EXPIRATION_MS,
labels=labels,
kms_key=kms_key)

Expand Down
Loading