-
Notifications
You must be signed in to change notification settings - Fork 266
Closed
Labels
🚨This issue needs some love.This issue needs some love.api: bigqueryIssues related to the BigQuery API.Issues related to the BigQuery API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
Environment details
- Specify the API at the beginning of the title. For example, "BigQuery: ...").
General, Core, and Other are also allowed as types - OS type and version: MAC OS Big Sur 11.5.2
- Java version: 8
- google-auth-library version(s): 1.1.0
Steps to reproduce
- Impersonate the account : gcloud config set auth/impersonate_service_account
- Set application default credentials : gcloud auth application-default login
Code example
import com.google.auth.oauth2.GoogleCredentials;
import com.google.cloud.bigquery.BigQuery;
GoogleCredentials credentials = ComputeEngineCredentials.getApplicationDefault();
BigQuery bigquery = BigQueryOptions.newBuilder().setProjectId(projectId).setCredentials(credentials).build()
.getService();
// exampleStack trace
Caused by: java.lang.ClassCastException: class com.google.common.collect.SingletonImmutableSet cannot be cast to class java.util.List (com.google.common.collect.SingletonImmutableSet is in unnamed module of loader 'app'; java.util.List is in module java.base of loader 'bootstrap')
at com.google.auth.oauth2.ImpersonatedCredentials.createScoped(ImpersonatedCredentials.java:367)
at com.google.cloud.ServiceOptions.getScopedCredentials(ServiceOptions.java:596)
at com.google.cloud.http.HttpTransportOptions.getHttpRequestInitializer(HttpTransportOptions.java:145)
at com.google.cloud.bigquery.spi.v2.HttpBigQueryRpc.<init>(HttpBigQueryRpc.java:105)
at com.google.cloud.bigquery.BigQueryOptions$DefaultBigQueryRpcFactory.create(BigQueryOptions.java:56)
at com.google.cloud.bigquery.BigQueryOptions$DefaultBigQueryRpcFactory.create(BigQueryOptions.java:50)
at com.google.cloud.ServiceOptions.getRpc(ServiceOptions.java:560)
at com.google.cloud.bigquery.BigQueryOptions.getBigQueryRpcV2(BigQueryOptions.java:125)
at com.google.cloud.bigquery.BigQueryImpl.<init>(BigQueryImpl.java:249)
at com.google.cloud.bigquery.BigQueryOptions$DefaultBigQueryFactory.create(BigQueryOptions.java:46)
at com.google.cloud.bigquery.BigQueryOptions$DefaultBigQueryFactory.create(BigQueryOptions.java:40)
at com.google.cloud.ServiceOptions.getService(ServiceOptions.java:540)
External references such as API reference guides
- NA
Any additional information below
Metadata
Metadata
Assignees
Labels
🚨This issue needs some love.This issue needs some love.api: bigqueryIssues related to the BigQuery API.Issues related to the BigQuery API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.