Repository navigation
fix(bigquery-jdbc): apply per-table expiration to generated LargeResultDataset temp tables - #15333
Open
keshavdandeva wants to merge 1 commit into
Open
keshavdandeva wants to merge 1 commit into
keshavdandeva wants to merge 1 commit into
Conversation
This was referenced Dec 1, 2026
fix(bigquery-jdbc): validate LargeResult properties and use UUID temp tables with WRITE_EMPTY
#15257
Open
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces explicit tracking of destination dataset expiration times and implements a best-effort mechanism to set expiration times on generated temporary destination tables, including connection-level memoization of permission errors to avoid redundant API calls. The review feedback correctly identifies that setting the expiration time to Long.MAX_VALUE will result in a 400 Bad Request error from BigQuery, which has a maximum supported timestamp of 9999-12-31 23:59:59.999 UTC (253402300799000L). Capping the expiration time to this maximum value and updating the corresponding test assertion is recommended.
keshavdandeva
force-pushed
the
jdbc/large-results-4-table-expiration
branch
from
December 1, 2026 17:51
7906d4e to
9681094
Compare
…ltDataset temp tables
keshavdandeva
force-pushed
the
jdbc/large-results-4-table-expiration
branch
from
December 1, 2026 20:09
9681094 to
24aaa5f
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
b/584840569
Summary of Changes
LargeResultDestinations,BigQueryStatement):defaultTableLifetime > 0(including any dataset auto-created in PR 3), never calltables.update— the dataset's configured TTL is respected with zero extra RPCs.LargeResultDatasethas nodefaultTableLifetime(nullor<= 0, or when a409reload failed for a service account), best-effort patchexpirationTime = now + LargeResultsDatasetExpirationTime(default1h) on generated temporary tables (LargeResultTable == null) as a crash-leak safety net (b/584840569). ExplicitLargeResultTabletables are never patched.DataSource.javaorBigQuerySettings.java(no explicit-vs-default property tri-state).403 accessDeniedmemoization (LargeResultDestinations,BigQueryConnection):tables.updatenever fails query execution. If BigQuery returns HTTP403with reasonaccessDenied, memoize per connection so subsequent queries skiptables.update; non-IAM failures (503,403 rateLimitExceeded) log a warning without poisoning the connection.BigQueryConnection.resetForReuse()callslargeResultDestinations.resetForReuse()to clear memoized state on pooled connection reuse.USER_GUIDE.md,BigQueryStatementTest):null/zero/finite dataset TTLs,=0URL fallback,403 accessDeniedmemoization, non-IAM errors,resetForReuse(), and concurrentStatement.close()during table expiration.Decisions Taken & Open Review Points
LargeResultsDatasetExpirationTime=3600000(common in Simba URL templates) overrode a dataset's admin-configureddefaultTableLifetime. Always respecting finite dataset TTLs eliminates that footgun, eliminates changes toDataSource/BigQuerySettings, and keeps extra RPCs at zero for datasets with a TTL.1hdefault) on no-TTL datasets: On pre-existing datasets with nodefaultTableLifetime, settingexpirationTime = now + LargeResultsDatasetExpirationTime(default 1h) ensures temp tables expire even if the JVM crashes before PR 5'sResultSet.close()cleanup runs (b/584840569), at the cost that reads open longer than 1 hour on a no-TTL dataset require increasingLargeResultsDatasetExpirationTime(or setting a dataset TTL). Please weigh in if you prefer:LargeResultsDatasetExpirationTimedefault (1h),24h) when patching per-table expiration on no-TTL datasets, or