Skip to content
This repository has been archived by the owner on Nov 11, 2022. It is now read-only.

Commit

Permalink
fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
dhalperi committed Feb 6, 2017
1 parent 5625ffb commit 9c59d78
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,7 @@ public long getEstimatedSizeBytes(PipelineOptions options) throws Exception {
public BoundedReader<TableRow> createReader(PipelineOptions options) throws IOException {
BigQueryOptions bqOptions = options.as(BigQueryOptions.class);
return new BigQueryReader(this, bqServices.getReaderFromQuery(
bqOptions, createBasicQueryConfig(), executingProject.get()));
bqOptions, executingProject.get(), createBasicQueryConfig()));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public interface BigQueryServices extends Serializable {
* Returns a real, mock, or fake {@link BigQueryJsonReader} to query tables.
*/
BigQueryJsonReader getReaderFromQuery(
BigQueryOptions bqOptions, JobConfigurationQuery queryConfig, String projectId);
BigQueryOptions bqOptions, String projectId, JobConfigurationQuery queryConfig);

/**
* An interface for the Cloud BigQuery load service.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ public BigQueryJsonReader getReaderFromTable(BigQueryOptions bqOptions, TableRef

@Override
public BigQueryJsonReader getReaderFromQuery(
BigQueryOptions bqOptions, JobConfigurationQuery queryConfig, String projectId) {
return BigQueryJsonReaderImpl.fromQuery(bqOptions, queryConfig, projectId);
BigQueryOptions bqOptions, String projectId, JobConfigurationQuery queryConfig) {
return BigQueryJsonReaderImpl.fromQuery(bqOptions, projectId, queryConfig);
}

@VisibleForTesting
Expand Down Expand Up @@ -516,9 +516,7 @@ private BigQueryJsonReaderImpl(BigQueryTableRowIterator iterator) {
}

private static BigQueryJsonReader fromQuery(
BigQueryOptions bqOptions,
JobConfigurationQuery queryConfig,
String projectId) {
BigQueryOptions bqOptions, String projectId, JobConfigurationQuery queryConfig) {
return new BigQueryJsonReaderImpl(
BigQueryTableRowIterator.fromQuery(
queryConfig, projectId, Transport.newBigQueryClient(bqOptions).build()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,8 @@ private void deleteDataset(String datasetId) throws IOException, InterruptedExce
*/
private TableReference executeQueryAndWaitForCompletion()
throws IOException, InterruptedException {
checkState(projectId != null, "Cannot dryRun a query in unknown (null) project");
checkState(queryConfig != null, "Cannot dryRun a null query");
checkState(projectId != null, "Unable to execute a query without a configured project id");
checkState(queryConfig != null, "Unable to execute a query without a configured query");
// Dry run query to get source table location
Job dryRunJob = new Job()
.setConfiguration(new JobConfiguration()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public BigQueryJsonReader getReaderFromTable(

@Override
public BigQueryJsonReader getReaderFromQuery(
BigQueryOptions bqOptions, JobConfigurationQuery queryConfig, String projectId) {
BigQueryOptions bqOptions, String projectId, JobConfigurationQuery queryConfig) {
return new FakeBigQueryReader(jsonTableRowReturns);
}

Expand Down

0 comments on commit 9c59d78

Please sign in to comment.