@@ -55,6 +55,7 @@ public final class WriteChannelConfiguration implements LoadConfiguration, Seria
55
55
private final Clustering clustering ;
56
56
private final Boolean useAvroLogicalTypes ;
57
57
private final Map <String , String > labels ;
58
+ private List <String > decimalTargetTypes ;
58
59
59
60
public static final class Builder implements LoadConfiguration .Builder {
60
61
@@ -73,6 +74,7 @@ public static final class Builder implements LoadConfiguration.Builder {
73
74
private Clustering clustering ;
74
75
private Boolean useAvroLogicalTypes ;
75
76
private Map <String , String > labels ;
77
+ private List <String > decimalTargetTypes ;
76
78
77
79
private Builder () {}
78
80
@@ -93,6 +95,7 @@ private Builder(WriteChannelConfiguration writeChannelConfiguration) {
93
95
this .clustering = writeChannelConfiguration .clustering ;
94
96
this .useAvroLogicalTypes = writeChannelConfiguration .useAvroLogicalTypes ;
95
97
this .labels = writeChannelConfiguration .labels ;
98
+ this .decimalTargetTypes = writeChannelConfiguration .decimalTargetTypes ;
96
99
}
97
100
98
101
private Builder (com .google .api .services .bigquery .model .JobConfiguration configurationPb ) {
@@ -169,6 +172,9 @@ private Builder(com.google.api.services.bigquery.model.JobConfiguration configur
169
172
if (configurationPb .getLabels () != null ) {
170
173
this .labels = configurationPb .getLabels ();
171
174
}
175
+ if (loadConfigurationPb .getDecimalTargetTypes () != null ) {
176
+ this .decimalTargetTypes = loadConfigurationPb .getDecimalTargetTypes ();
177
+ }
172
178
}
173
179
174
180
@ Override
@@ -262,6 +268,12 @@ public Builder setLabels(Map<String, String> labels) {
262
268
return this ;
263
269
}
264
270
271
+ @ Override
272
+ public Builder setDecimalTargetTypes (List <String > decimalTargetTypes ) {
273
+ this .decimalTargetTypes = decimalTargetTypes ;
274
+ return this ;
275
+ }
276
+
265
277
@ Override
266
278
public WriteChannelConfiguration build () {
267
279
return new WriteChannelConfiguration (this );
@@ -284,6 +296,7 @@ protected WriteChannelConfiguration(Builder builder) {
284
296
this .clustering = builder .clustering ;
285
297
this .useAvroLogicalTypes = builder .useAvroLogicalTypes ;
286
298
this .labels = builder .labels ;
299
+ this .decimalTargetTypes = builder .decimalTargetTypes ;
287
300
}
288
301
289
302
@ Override
@@ -372,6 +385,11 @@ public Map<String, String> getLabels() {
372
385
return labels ;
373
386
}
374
387
388
+ @ Override
389
+ public List <String > getDecimalTargetTypes () {
390
+ return decimalTargetTypes ;
391
+ }
392
+
375
393
@ Override
376
394
public Builder toBuilder () {
377
395
return new Builder (this );
@@ -393,7 +411,8 @@ MoreObjects.ToStringHelper toStringHelper() {
393
411
.add ("timePartitioning" , timePartitioning )
394
412
.add ("clustering" , clustering )
395
413
.add ("useAvroLogicalTypes" , useAvroLogicalTypes )
396
- .add ("labels" , labels );
414
+ .add ("labels" , labels )
415
+ .add ("decimalTargetTypes" , decimalTargetTypes );
397
416
}
398
417
399
418
@ Override
@@ -424,7 +443,8 @@ public int hashCode() {
424
443
timePartitioning ,
425
444
clustering ,
426
445
useAvroLogicalTypes ,
427
- labels );
446
+ labels ,
447
+ decimalTargetTypes );
428
448
}
429
449
430
450
WriteChannelConfiguration setProjectId (String projectId ) {
@@ -495,6 +515,9 @@ com.google.api.services.bigquery.model.JobConfiguration toPb() {
495
515
if (labels != null ) {
496
516
jobConfiguration .setLabels (labels );
497
517
}
518
+ if (decimalTargetTypes != null ) {
519
+ loadConfigurationPb .setDecimalTargetTypes (decimalTargetTypes );
520
+ }
498
521
jobConfiguration .setLoad (loadConfigurationPb );
499
522
return jobConfiguration ;
500
523
}
0 commit comments