Skip to content

Commit de38fec

Browse files
committed
Check that billing project is not null in BigQuerySourceBase
1 parent 82fe92a commit de38fec

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQuerySourceBase.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,13 @@ protected ExtractResult extractFiles(PipelineOptions options) throws Exception {
134134
BigQueryHelpers.getDatasetLocation(
135135
datasetService, tableToExtract.getProjectId(), tableToExtract.getDatasetId());
136136
String bqProjectId =
137-
bqOptions.getBigQueryProject() != null
138-
? bqOptions.getBigQueryProject()
139-
: bqOptions.getProject();
137+
checkArgumentNotNull(
138+
bqOptions.getBigQueryProject() != null
139+
? bqOptions.getBigQueryProject()
140+
: bqOptions.getProject(),
141+
"Cannot export data from table "
142+
+ tableToExtract
143+
+ " without a valid billing project. Check that either --bigQueryProject or --project has been set.");
140144
List<ResourceId> tempFiles =
141145
executeExtract(
142146
extractJobId,

0 commit comments

Comments
 (0)