Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ private void configureBigQuerySink() {
*/
private void configureTable(Schema schema) {
AbstractBigQuerySinkConfig config = getConfig();
Table table = BigQueryUtil.getBigQueryTable(config.getProject(), config.getDataset(),
Table table = BigQueryUtil.getBigQueryTable(config.getDatasetProject(), config.getDataset(),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if config.getProject() is provided? In that case we will rely on config.getDatasetProject()?

Copy link
Copy Markdown
Contributor Author

@flakrimjusufi flakrimjusufi Feb 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If config.getProject() and config.getDatasetProject() are provided, then datasetProject will get priority.

If datasetProject is not defined, then config.getProject() will be set up in configuration.
That's how it is defined in AbstractBigQuerySinkConfig

@Nullable
public String getDatasetProject() {
if (GCPConfig.AUTO_DETECT.equalsIgnoreCase(datasetProject)) {
return ServiceOptions.getDefaultProjectId();
}
return Strings.isNullOrEmpty(datasetProject) ? getProject() : datasetProject;
}

config.getTable(),
config.getServiceAccount(),
config.isServiceAccountFilePath());
Expand All @@ -253,7 +253,7 @@ private void validateConfiguredSchema(Schema schema, FailureCollector collector)
}

String tableName = config.getTable();
Table table = BigQueryUtil.getBigQueryTable(config.getProject(), config.getDataset(), tableName,
Table table = BigQueryUtil.getBigQueryTable(config.getDatasetProject(), config.getDataset(), tableName,
config.getServiceAccount(), config.isServiceAccountFilePath(),
collector);

Expand Down