Skip to content
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

Make BQ file load limit controls public #32101

Merged
merged 1 commit into from
Aug 16, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -3194,14 +3194,34 @@ public Write<T> withMaxFilesPerBundle(int maxFilesPerBundle) {
return toBuilder().setMaxFilesPerBundle(maxFilesPerBundle).build();
}

@VisibleForTesting
Write<T> withMaxFileSize(long maxFileSize) {
/**
* Controls the maximum byte size per file to be loaded into BigQuery. If the amount of data
* written to one file reaches this threshold, we will close that file and continue writing in a
* new file.
*
* <p>The default value (4 TiB) respects BigQuery's maximum number of source URIs per job
* configuration.
*
* @see <a href="https://cloud.google.com/bigquery/quotas#load_jobs">BigQuery Load Job
* Limits</a>
*/
public Write<T> withMaxFileSize(long maxFileSize) {
checkArgument(maxFileSize > 0, "maxFileSize must be > 0, but was: %s", maxFileSize);
return toBuilder().setMaxFileSize(maxFileSize).build();
}

@VisibleForTesting
Write<T> withMaxFilesPerPartition(int maxFilesPerPartition) {
/**
* Controls how many files will be assigned to a single BigQuery load job. If the number of
* files increases past this threshold, we will spill it over into multiple load jobs as
* necessary.
*
* <p>The default value (10,000 files) respects BigQuery's maximum number of source URIs per job
* configuration.
*
* @see <a href="https://cloud.google.com/bigquery/quotas#load_jobs">BigQuery Load Job
* Limits</a>
*/
public Write<T> withMaxFilesPerPartition(int maxFilesPerPartition) {
checkArgument(
maxFilesPerPartition > 0,
"maxFilesPerPartition must be > 0, but was: %s",
Expand Down
Loading