Skip to content

Commit

Permalink
Set billing project id as the quota project id in BigQuery (trinodb#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
regadas authored and GitHub Enterprise committed Jun 26, 2023
1 parent 66c0d5e commit e177cff
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/src/main/sphinx/connector/bigquery.rst
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ Configuration properties
Property Description Default
===================================================== ============================================================== ======================================================
``bigquery.project-id`` The Google Cloud Project ID where the data reside Taken from the service account
``bigquery.parent-project-id`` The project ID Google Cloud Project to bill for the export Taken from the service account
``bigquery.parent-project-id`` The project ID Google Cloud Project that will be used for Taken from the service account
billing and quota limits.
``bigquery.parallelism`` The number of partitions to split the data into The number of executors
``bigquery.views-enabled`` Enables the connector to read from views and not only tables. ``false``
Please read `this section <#reading-from-views>`_ before
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public TableInfo getCachedTable(Duration viewExpiration, TableInfo remoteTableId

/**
* The Google Cloud Project ID that will be used to create the underlying BigQuery read session.
* Effectively, this is the project that will be used for billing attribution.
* Effectively, this is the project that will be used for billing and quota attribution.
*/
public String getParentProjectId()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public BigQueryOptions.Builder configure(BigQueryOptions.Builder builder, Connec
String billingProjectId = calculateBillingProjectId(parentProjectId, credentials);
credentials.ifPresent(builder::setCredentials);
builder.setProjectId(billingProjectId);
builder.setQuotaProjectId(billingProjectId);
return builder;
}

Expand Down

0 comments on commit e177cff

Please sign in to comment.