Skip to content

Commit afd3bbd

Browse files
Praful Makanichingor13
authored andcommitted
---
yaml --- r: 13691 b: refs/heads/autosynth-logging c: 70d7efb h: refs/heads/master i: 13689: 7f154c7 13687: f165753
1 parent aa892e3 commit afd3bbd

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
@@ -105,7 +105,7 @@ refs/tags/v0.61.0: e4b526656bb1bf5eefd0ee578b7405147821225e
105105
refs/tags/v0.62.0: bbede7385d48ba08f487bdd29ec10668ace96396
106106
refs/heads/0.60.0-alpha: 10939381ffe0b8da32db4fe3087c86e3aa7f3e55
107107
refs/heads/autosynth-dlp: 90e4efe3be392e89dc36bce22afab981a905b1bc
108-
refs/heads/autosynth-logging: 6e2c2dd890fe445cc896f0ddcb30309213759ee2
108+
refs/heads/autosynth-logging: 70d7efb2a5c33e6755a6c4c3ce0e52f2dee75c87
109109
refs/heads/dupes: 3478c5d81fd242d0e985656645a679420a2060c2
110110
refs/tags/v0.63.0: 94f19b71d40f46b36120e7b9d78a1a3d41bfcbd6
111111
refs/tags/v0.64.0: 456e8fbd129deced3ca025f239a2d8a82bde1d0a

branches/autosynth-logging/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)