Source:
public void importFromGcs( String projectId, TableReference tableRef, @Nullable TableSchema schema, @Nullable TimePartitioning timePartitioning, @Nullable String kmsKeyName, BigQueryFileFormat sourceFormat, String writeDisposition, List<String> gcsPaths, boolean awaitCompletion) throws IOException, InterruptedException { logger.atInfo().log( "Importing into table '%s' from %s paths; path[0] is '%s'; awaitCompletion: %s; TimePartitioning: {}", BigQueryStrings.toString(tableRef), gcsPaths.size(), gcsPaths.isEmpty() ? "(empty)" : gcsPaths.get(0), awaitCompletion, timePartitioning != null ? timePartitioning : "null"); JobConfigurationLoad loadConfig = new JobConfigurationLoad(); loadConfig.setSchema(schema); loadConfig.setSourceFormat(sourceFormat.getFormatIdentifier()); loadConfig.setSourceUris(gcsPaths); loadConfig.setDestinationTable(tableRef); if(timePartitioning != null) { loadConfig.setTimePartitioning(timePartitioning); } loadConfig.setWriteDisposition(writeDisposition); if (!Strings.isNullOrEmpty(kmsKeyName)) { loadConfig.setDestinationEncryptionConfiguration( new EncryptionConfiguration().setKmsKeyName(kmsKeyName)); } if (schema == null) { logger.atInfo().log("No import schema provided, auto detecting schema."); loadConfig.setAutodetect(true); } else { logger.atInfo().log("Using provided import schema '%s'.", schema.toString()); } JobConfiguration config = new JobConfiguration(); config.setLoad(loadConfig); Dataset dataset = service.datasets().get(tableRef.getProjectId(), tableRef.getDatasetId()).execute(); JobReference jobReference = createJobReference(projectId, "direct-bigqueryhelper-import", dataset.getLocation()); Job job = new Job(); job.setConfiguration(config); job.setJobReference(jobReference); insertJobOrFetchDuplicate(projectId, job); if (awaitCompletion) { BigQueryUtils.waitForJobCompletion( getRawBigquery(), projectId, jobReference, NOP_PROGRESSABLE); } }

Target:
public void importFromGcs( String projectId, TableReference tableRef, @Nullable TableSchema schema, @Nullable TimePartitioning timePartitioning, @Nullable String kmsKeyName, BigQueryFileFormat sourceFormat, String writeDisposition, List<String> gcsPaths, boolean awaitCompletion) throws IOException, InterruptedException { logger.atInfo().log( "Importing into table '%s' from %s paths; path[0] is '%s'; awaitCompletion: %s;" + " timePartitioning: %s", lazy(() -> BigQueryStrings.toString(tableRef)), gcsPaths.size(), gcsPaths.isEmpty() ? "(empty)" : gcsPaths.get(0), awaitCompletion, timePartitioning); JobConfigurationLoad loadConfig = new JobConfigurationLoad(); loadConfig.setSchema(schema); loadConfig.setSourceFormat(sourceFormat.getFormatIdentifier()); loadConfig.setSourceUris(gcsPaths); loadConfig.setDestinationTable(tableRef); loadConfig.setTimePartitioning(timePartitioning); loadConfig.setWriteDisposition(writeDisposition); if (!Strings.isNullOrEmpty(kmsKeyName)) { loadConfig.setDestinationEncryptionConfiguration( new EncryptionConfiguration().setKmsKeyName(kmsKeyName)); } if (schema == null) { logger.atInfo().log("No import schema provided, auto detecting schema."); loadConfig.setAutodetect(true); } else { logger.atInfo().log("Using provided import schema '%s'.", schema.toString()); } JobConfiguration config = new JobConfiguration(); config.setLoad(loadConfig); Dataset dataset = service.datasets().get(tableRef.getProjectId(), tableRef.getDatasetId()).execute(); JobReference jobReference = createJobReference(projectId, "direct-bigqueryhelper-import", dataset.getLocation()); Job job = new Job(); job.setConfiguration(config); job.setJobReference(jobReference); insertJobOrFetchDuplicate(projectId, job); if (awaitCompletion) { BigQueryUtils.waitForJobCompletion(getRawBigquery(), projectId, jobReference, () -> {}); } }