Skip to content

Commit 36b8dcb

Browse files
Praful Makanichingor13
authored andcommitted
---
yaml --- r: 14655 b: refs/heads/autosynth-asset c: 70d7efb h: refs/heads/master i: 14653: 89801ef 14651: d513d3e 14647: 352a3b4 14639: b2e15d9 14623: 645c6b9 14591: f304256
1 parent 01e69ff commit 36b8dcb

2 files changed

Lines changed: 30 additions & 1 deletion

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ refs/heads/autosynth-vision: b8e47d76578b5f150ef530072ea7e485e2b02ca0
122122
refs/heads/spanner: b01127f885b4611bf1852abb0ce481eeb7fcc131
123123
refs/tags/v0.68.0: 9cc799fcf68c82ab431d425fefa58ef615ce8e5b
124124
refs/tags/v0.69.0: 78f67a29e8b9c46ba01de566a2eae0fd1c03edea
125-
refs/heads/autosynth-asset: 6e2c2dd890fe445cc896f0ddcb30309213759ee2
125+
refs/heads/autosynth-asset: 70d7efb2a5c33e6755a6c4c3ce0e52f2dee75c87
126126
refs/heads/autosynth-automl: d4315b3596bac160e3439432c54435f44b09953e
127127
refs/heads/autosynth-bigquerydatatransfer: 2a9f3938237f85a8919602d74011326580ff387f
128128
refs/heads/autosynth-bigquerystorage: 99aee05df348f39d98b6fb23c292006f1d2a6c28

branches/autosynth-asset/google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryJobConfiguration.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public final class QueryJobConfiguration extends JobConfiguration {
6060
private final Boolean dryRun;
6161
private final Boolean useLegacySql;
6262
private final Integer maximumBillingTier;
63+
private final Long maximumBytesBilled;
6364
private final List<SchemaUpdateOption> schemaUpdateOptions;
6465
private final EncryptionConfiguration destinationEncryptionConfiguration;
6566
private final TimePartitioning timePartitioning;
@@ -104,6 +105,7 @@ public static final class Builder
104105
private Boolean dryRun;
105106
private Boolean useLegacySql = false;
106107
private Integer maximumBillingTier;
108+
private Long maximumBytesBilled;
107109
private List<SchemaUpdateOption> schemaUpdateOptions;
108110
private EncryptionConfiguration destinationEncryptionConfiguration;
109111
private TimePartitioning timePartitioning;
@@ -131,6 +133,7 @@ private Builder(QueryJobConfiguration jobConfiguration) {
131133
this.dryRun = jobConfiguration.dryRun;
132134
this.useLegacySql = jobConfiguration.useLegacySql;
133135
this.maximumBillingTier = jobConfiguration.maximumBillingTier;
136+
this.maximumBytesBilled = jobConfiguration.maximumBytesBilled;
134137
this.schemaUpdateOptions = jobConfiguration.schemaUpdateOptions;
135138
this.destinationEncryptionConfiguration = jobConfiguration.destinationEncryptionConfiguration;
136139
this.timePartitioning = jobConfiguration.timePartitioning;
@@ -167,6 +170,9 @@ private Builder(com.google.api.services.bigquery.model.JobConfiguration configur
167170
if (queryConfigurationPb.getMaximumBillingTier() != null) {
168171
maximumBillingTier = queryConfigurationPb.getMaximumBillingTier();
169172
}
173+
if (queryConfigurationPb.getMaximumBytesBilled() != null) {
174+
maximumBytesBilled = queryConfigurationPb.getMaximumBytesBilled();
175+
}
170176
dryRun = configurationPb.getDryRun();
171177
if (queryConfigurationPb.getDestinationTable() != null) {
172178
destinationTable = TableId.fromPb(queryConfigurationPb.getDestinationTable());
@@ -482,6 +488,18 @@ public Builder setMaximumBillingTier(Integer maximumBillingTier) {
482488
return this;
483489
}
484490

491+
/**
492+
* Limits the bytes billed for this job. Queries that will have bytes billed beyond this limit
493+
* will fail (without incurring a charge). If unspecified, this will be set to your project
494+
* default.
495+
*
496+
* @param maximumBytesBilled maximum bytes billed for this job
497+
*/
498+
public Builder setMaximumBytesBilled(Long maximumBytesBilled) {
499+
this.maximumBytesBilled = maximumBytesBilled;
500+
return this;
501+
}
502+
485503
/**
486504
* [Experimental] Sets options allowing the schema of the destination table to be updated as a
487505
* side effect of the query job. Schema update options are supported in two cases: when
@@ -538,6 +556,7 @@ private QueryJobConfiguration(Builder builder) {
538556
this.dryRun = builder.dryRun;
539557
this.useLegacySql = builder.useLegacySql;
540558
this.maximumBillingTier = builder.maximumBillingTier;
559+
this.maximumBytesBilled = builder.maximumBytesBilled;
541560
this.schemaUpdateOptions = builder.schemaUpdateOptions;
542561
this.destinationEncryptionConfiguration = builder.destinationEncryptionConfiguration;
543562
this.timePartitioning = builder.timePartitioning;
@@ -685,6 +704,11 @@ public Integer getMaximumBillingTier() {
685704
return maximumBillingTier;
686705
}
687706

707+
/** Returns the optional bytes billed limit for this job. */
708+
public Long getMaximumBytesBilled() {
709+
return maximumBytesBilled;
710+
}
711+
688712
/**
689713
* [Experimental] Returns options allowing the schema of the destination table to be updated as a
690714
* side effect of the query job. Schema update options are supported in two cases: when
@@ -731,6 +755,7 @@ ToStringHelper toStringHelper() {
731755
.add("dryRun", dryRun)
732756
.add("useLegacySql", useLegacySql)
733757
.add("maximumBillingTier", maximumBillingTier)
758+
.add("maximumBytesBilled", maximumBytesBilled)
734759
.add("schemaUpdateOptions", schemaUpdateOptions)
735760
.add("timePartitioning", timePartitioning)
736761
.add("clustering", clustering);
@@ -762,6 +787,7 @@ public int hashCode() {
762787
dryRun,
763788
useLegacySql,
764789
maximumBillingTier,
790+
maximumBytesBilled,
765791
schemaUpdateOptions,
766792
timePartitioning,
767793
clustering);
@@ -835,6 +861,9 @@ com.google.api.services.bigquery.model.JobConfiguration toPb() {
835861
if (maximumBillingTier != null) {
836862
queryConfigurationPb.setMaximumBillingTier(maximumBillingTier);
837863
}
864+
if (maximumBytesBilled != null) {
865+
queryConfigurationPb.setMaximumBytesBilled(maximumBytesBilled);
866+
}
838867
if (schemaUpdateOptions != null) {
839868
ImmutableList.Builder<String> schemaUpdateOptionsBuilder = new ImmutableList.Builder<>();
840869
for (JobInfo.SchemaUpdateOption schemaUpdateOption : schemaUpdateOptions) {

0 commit comments

Comments
 (0)