crazy8
crazy8

Reputation: 328

Who pays query costs on datasets across multiple users in BigQuery?

I've granted an internal user permission to query datasets in our Project, under the 'IAM & admin' section.

When the user queries the tables, will the cost of running the queries be billed to the Project's account? Ideally any costs associated with a user running a query would be charged to one central account. Or will the user be charged on their own separate bill?

Does billing work the same using the 'Share Dataset' option instead of adding a user under the IAM section? As in, the user email whom the dataset is shared with will have any related query costs applied to the project owner's account or their own account?

Upvotes: 6

Views: 4398

Answers (1)

Mikhail Berlyant
Mikhail Berlyant

Reputation: 173106

BigQuery storage costs are billed to the billing account attached to the project where data resides

Meantime, query charges associated with BigQuery jobs are billed to the billing account attached to the project from which the user runs jobs (query).

If a user uses the BigQuery UI - the project you (user) see in the project list selector on top gets billed for all queries executed within it, no matter where the data that is being queried actually resides.

If a user uses API or any client library - so called billing project is a part of respective API or client's method that needs to be provided by user

For project to be qualified for a user to run queries from, and thus to use it as a billing project, the user must have bigquery.jobs.create permission set in IAM.
See more about roles and permissions here - https://cloud.google.com/bigquery/docs/access-control#permissions_and_roles

Using the 'Share Dataset' option just gives a user specific permission to have access to respective dataset

Hope this clears your question

Upvotes: 17

Related Questions