@@ -38,6 +38,7 @@ public final class LoadJobConfiguration extends JobConfiguration implements Load
38
38
private static final long serialVersionUID = -2673554846792429829L ;
39
39
40
40
private final List <String > sourceUris ;
41
+ private final String fileSetSpecType ;
41
42
private final TableId destinationTable ;
42
43
private final List <String > decimalTargetTypes ;
43
44
private final EncryptionConfiguration destinationEncryptionConfiguration ;
@@ -67,6 +68,7 @@ public static final class Builder extends JobConfiguration.Builder<LoadJobConfig
67
68
implements LoadConfiguration .Builder {
68
69
69
70
private List <String > sourceUris ;
71
+ private String fileSetSpecType ;
70
72
private TableId destinationTable ;
71
73
private List <String > decimalTargetTypes ;
72
74
private EncryptionConfiguration destinationEncryptionConfiguration ;
@@ -107,6 +109,7 @@ private Builder(LoadJobConfiguration loadConfiguration) {
107
109
this .schema = loadConfiguration .schema ;
108
110
this .ignoreUnknownValues = loadConfiguration .ignoreUnknownValues ;
109
111
this .sourceUris = loadConfiguration .sourceUris ;
112
+ this .fileSetSpecType = loadConfiguration .fileSetSpecType ;
110
113
this .schemaUpdateOptions = loadConfiguration .schemaUpdateOptions ;
111
114
this .autodetect = loadConfiguration .autodetect ;
112
115
this .destinationEncryptionConfiguration =
@@ -175,6 +178,9 @@ private Builder(com.google.api.services.bigquery.model.JobConfiguration configur
175
178
if (loadConfigurationPb .getSourceUris () != null ) {
176
179
this .sourceUris = ImmutableList .copyOf (configurationPb .getLoad ().getSourceUris ());
177
180
}
181
+ if (loadConfigurationPb .getFileSetSpecType () != null ) {
182
+ this .fileSetSpecType = loadConfigurationPb .getFileSetSpecType ();
183
+ }
178
184
if (loadConfigurationPb .getSchemaUpdateOptions () != null ) {
179
185
ImmutableList .Builder <JobInfo .SchemaUpdateOption > schemaUpdateOptionsBuilder =
180
186
new ImmutableList .Builder <>();
@@ -306,6 +312,17 @@ public Builder setSourceUris(List<String> sourceUris) {
306
312
return this ;
307
313
}
308
314
315
+ /**
316
+ * Defines how to interpret files denoted by URIs. By default the files are assumed to be data
317
+ * files (this can be specified explicitly via FILE_SET_SPEC_TYPE_FILE_SYSTEM_MATCH). A second
318
+ * option is "FILE_SET_SPEC_TYPE_NEW_LINE_DELIMITED_MANIFEST" which interprets each file as a
319
+ * manifest file, where each line is a reference to a file.
320
+ */
321
+ public Builder setFileSetSpecType (String fileSetSpecType ) {
322
+ this .fileSetSpecType = fileSetSpecType ;
323
+ return this ;
324
+ }
325
+
309
326
/**
310
327
* Defines the list of possible SQL data types to which the source decimal values are converted.
311
328
* This list and the precision and the scale parameters of the decimal field determine the
@@ -403,6 +420,7 @@ public LoadJobConfiguration build() {
403
420
private LoadJobConfiguration (Builder builder ) {
404
421
super (builder );
405
422
this .sourceUris = builder .sourceUris ;
423
+ this .fileSetSpecType = builder .fileSetSpecType ;
406
424
this .destinationTable = builder .destinationTable ;
407
425
this .decimalTargetTypes = builder .decimalTargetTypes ;
408
426
this .createDisposition = builder .createDisposition ;
@@ -497,6 +515,10 @@ public List<String> getSourceUris() {
497
515
return sourceUris ;
498
516
}
499
517
518
+ public String getFileSetSpecType () {
519
+ return fileSetSpecType ;
520
+ }
521
+
500
522
public List <String > getDecimalTargetTypes () {
501
523
return decimalTargetTypes ;
502
524
}
@@ -575,6 +597,7 @@ ToStringHelper toStringHelper() {
575
597
.add ("schema" , schema )
576
598
.add ("ignoreUnknownValue" , ignoreUnknownValues )
577
599
.add ("sourceUris" , sourceUris )
600
+ .add ("fileSetSpecType" , fileSetSpecType )
578
601
.add ("schemaUpdateOptions" , schemaUpdateOptions )
579
602
.add ("autodetect" , autodetect )
580
603
.add ("timePartitioning" , timePartitioning )
@@ -655,6 +678,9 @@ com.google.api.services.bigquery.model.JobConfiguration toPb() {
655
678
if (sourceUris != null ) {
656
679
loadConfigurationPb .setSourceUris (ImmutableList .copyOf (sourceUris ));
657
680
}
681
+ if (fileSetSpecType != null ) {
682
+ loadConfigurationPb .setFileSetSpecType (fileSetSpecType );
683
+ }
658
684
if (decimalTargetTypes != null ) {
659
685
loadConfigurationPb .setDecimalTargetTypes (ImmutableList .copyOf (decimalTargetTypes ));
660
686
}
0 commit comments