BigQuery LoadJobConfiguration doesn't respect destination dataset projectId #4482
Labels
api: bigquery
Issues related to the BigQuery API.
type: question
Request for information or clarification. Not an issue.
Steps to reproduce
gcloud auth application-default login
using an account from someProjectA
([email protected]
in the code below). That account has BigQuery admin role inProjectB
and no BigQuery permissions inProjectA
.Running the code below where
ProjectB
is some arbitrary GCP project different from the aboveProjectA
:results in the exception included below as the project from the default application credentials is used instead of the one specified for destination table.
Stacktrace
External references such as API reference guides used
I think there was a similar issue #3924 reported recently that got fixed in #4183 but it still doesn't work for me.
Workaround
Instead of using a default instance of
BigQuery
that would useProjectA
from the default credentials:BigQuery bigQuery = BigQueryOptions.getDefaultInstance().getService();
use an instance that sets the default
projectID
toProjectB
explicitly:BigQuery bigQuery = BigQueryOptions.newBuilder().setProjectId("ProjectB").build().getService();
Thanks!
The text was updated successfully, but these errors were encountered: