-
Notifications
You must be signed in to change notification settings - Fork 130
Closed
Labels
api: bigqueryIssues related to the googleapis/java-bigquery API.Issues related to the googleapis/java-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
Thanks for stopping by to let us know something could be better!
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 Ventura / Linux Ubuntu /
- Java version: 17 adoptium
- version(s): 2.22.0 2.19.1
Steps to reproduce
- create client with non-default credentials.
- run query using that takes longer than 10 seconds so that it falls out of the fast query pathway
- 💥
Code:
// don't have the GOOGLE_APPLICATION_CREDENTIALS env variable set.
BigQueryCredentials credentials = ServiceAccountCredentials.fromStream(inStream)
BigQueryOptions bigQueryOptions = BigQueryOptions.newBuilder()
.setProjectId(projectId)
.setCredentials(credentials)
.setLocation(region)
.build()
BigQuery bigquery = bigQueryOptions.getService()
ConneptionSettings connectionSettings = ConnectionSettings.newBuilder()
.setUseReadAPI(false)
.setRequestTimeout(10L)
.setMaxResults(100L)
.setUseQueryCache(true)
.build();
Connection connection = bigquery.createConnection(connectionSettings);
String selectQuery = "<query that takes a little while and moves past the initial jobs.query timeout";
ListenableFuture<ExecuteSelectResponse> executeSelectFuture = connection.executeSelectAsync(selectQuery, ...);Stack trace
The Application Default Credentials are not available. They are available if running in Google Compute Engine. Otherwise, the environment variable GOOGLE_APPLICATION_CREDENTIALS must be defined pointing to a file defining the credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information.
External references such as API reference guides
If the highThroughPut read path is hit, a BigQueryReadClient is created using the default BigQueryReadClient.create() method. here.
Because no credentials are passed, this looks for the GOOGLE_APPLICATION_CREDENTIALS instead of passing along the credentials that are configured for the bigquery client being used by the Connection.
alfasapy
Metadata
Metadata
Assignees
Labels
api: bigqueryIssues related to the googleapis/java-bigquery API.Issues related to the googleapis/java-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.