ProjectId
Specifies the Google Cloud project used to resolve unqualified table names and execute jobs in Google BigQuery.
Data Type
string
Default Value
""
Remarks
This property works in combination with BillingProjectId to determine how queries are billed and how table names are resolved.
Job Execution
The server must create a Google BigQuery job to execute certain operations, including:
- Complex SELECT statements
- UPDATE and DELETE statements
- INSERT statements when InsertMode is set to DML
The job’s billing project is selected using the following priority:
- BillingProjectId is used if it is set.
- Otherwise, this property is used.
- If both are unset, the project is determined from the first fully qualified table in the query. A fully qualified table name includes the project ID, dataset ID, and table name, in the format: project.dataset.table
SELECT FirstName, LastName FROM `psychic-valve-137816`.`Northwind`.`customers`
This query runs under the psychic-valve-137816 project.
Note: When QueryPassthrough is enabled, only rules 1 and 2 apply. Either BillingProjectId or this property must be set to execute passthrough queries.
Table Resolution
This property also defines the default data project used to resolve unqualified table names.
In contrast to job execution (which prioritizes BillingProjectId), unqualified table references are resolved using ProjectId first.
When a table reference does not include a project, the server uses the following order to determine the project:
- This property, if set
- Then BillingProjectId
- If both are unset, the project is determined from the first fully qualified table in the query
/* Unqualified table: resolved using ProjectId */ SELECT FirstName, LastName FROM `Northwind`.`customers` /* Fully qualified table: resolved using specified project */ SELECT FirstName, LastName FROM `psychic-valve-137816`.`Northwind`.`customers` /* Mixed example: 'orders' is resolved using project from 'customers' */ SELECT * FROM `psychic-valve-137816`.`Northwind`.`customers` INNER JOIN `Northwind`.`orders` ON ...
Note: When QueryPassthrough is enabled, only this property and BillingProjectId can be used to resolve unqualified tables. All cross-project references must be fully qualified.
Set this property to your active Google Cloud project to control billing and resolve table references when queries omit full project names.